matteobaccan/owner

Throw NullPointerException at parsing

Closed this issue · 2 comments

Owner is really a great library. But it has some issues:

  • It really should natively support overwriting configuration properties via command line. This has already been requested and discussed in other thread. Meanwhile I managed to combine Owner with apache-commons-cli, which works. But again: Owner should support this natively. IDeally Owner should provide a CommandLineArgumentSource that can be given in the annotation of the Config interface.
  • Owner should throw a "MissingPropertyDefinitionException" at parse time, when a property that is defined in the Config interface is not defined anywhere. Currently it throws a NullPointerException at runtime when you try to read an undefined property. If you forget to define a prop in your .property file the user should immidiately be notified.

Hi.

It is possible to overwrite properties through system properties, that can be specified at the command line
http://owner.aeonbits.org/docs/importing-properties/

Validation at creation time is more complex that can appear at first sight, since there is also hot reload. It was planned to be implemented, but I would like to make a good implementation. At the moment I'm not actively developing on this project, for health and personal reasons. By the way the library should allow to implement all validation you need though reload events.

Check if your problem can be solved by specifying a @DefaultValue