refactor: avoid unneeded initializations in injection contexts by metacosm · Pull Request #2950 · operator-framework/java-operator-sdk

@metacosm

@metacosm

Signed-off-by: Chris Laprun <claprun@redhat.com>

xstefank

@metacosm

csviri


private void init(ConfigurationService configurationService, boolean allowDeferredInit) {
if (configurationService == null) {
if (!allowDeferredInit) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a unit test for this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test, though it's not great and additional documentation, along with a protected method for subclasses to set the configuration service after intialization, if needed.

csviri

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, if there is an elegant way pls add unit test so we don't break this in the future.

@metacosm

Signed-off-by: Chris Laprun <claprun@redhat.com>

csviri