supercargo / guice-persist-jooq

Guice-persist extension for using jOOQ based persistence layer
Apache License 2.0
22 stars 9 forks source link

Configuration injection is not optional #4

Closed GuiSim closed 7 years ago

GuiSim commented 7 years ago
  @Inject
  private Configuration configuration = null;

The documentation mentions that providing a Configuration instance is optional but that is not the case. In order to declare an Inject as optional, you need to use @Inject(optional=true). It should also probably be @Nullable.

See https://github.com/google/guice/wiki/Injections#optional-injections

If you agree, I'll do a pull request with a fix.

EDIT: The same seems true for Settings

supercargo commented 7 years ago

Yes, thank you for the report. Happy to take a look at a PR.