Code Monkey home page Code Monkey logo

Comments (7)

dasavick avatar dasavick commented on May 29, 2024

Please make sure a default constructor is available. Otherwise, okaeri-configs can in some cases create the instance with unsafe which does not fill default values.

from okaeri-configs.

plytki avatar plytki commented on May 29, 2024

What do you mean by default constructor?

from okaeri-configs.

dasavick avatar dasavick commented on May 29, 2024

A default constructor is a constructor which can be called with no arguments (either defined with an empty parameter list, or with default arguments provided for every parameter).

This can be also achieved using @NoArgsConstructor from Lombok.

from okaeri-configs.

plytki avatar plytki commented on May 29, 2024

I tried this way but there is still a null value.

from okaeri-configs.

dasavick avatar dasavick commented on May 29, 2024

Please provide specific instructions where and what to add to reproduce the problem, as your configuration has multiple levels.

from okaeri-configs.

plytki avatar plytki commented on May 29, 2024

These variables are already added to the PluginConfiguration.java file so you just have to run the creator to see newly added null values. On line 168 you have that 2 last constructor params that are null values when you try to update the config with provided ConfigManager creator. This built-in MySQL class that produces null values is initialized on line 149.

from okaeri-configs.

dasavick avatar dasavick commented on May 29, 2024

That explains a bit. Please use fields for the default values, instead of the full constructor for the subconfig initialization, if you want okaeri-configs to add the new default values.

// don't
public MySQL mysql = new MySQL("localhost", 3306 /* ... */);
// do
public String hostname = "localhost";
public int port = 3306;
// ...

Note that this behavior is indeed correct, because you are only providing the default value for the mysql itself, which is, in fact, already present when adding properties to the MySQL class.

from okaeri-configs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.