1

I'm using Guice (v 3.0) and have a value that is being injected into a constructor. This value can be null, so I have annotated the parameter in the constructor with @Nullable (from javax.annotations).

public MyClass(Parameter1 p1, @Nullable Parameter2 p2) {
}

However, Guice is complaining with provision errors when it comes to initialise the class:

parameter 2 of com.abc.MyClass.<init>() is not @Nullable

I don't understand why this is not working, is there something else I need to do?

Dave Richardson
  • 4,880
  • 7
  • 32
  • 47

1 Answers1

1

Turned out to be an eclipse problem - wasn't refreshing my workspace properly.

Dave Richardson
  • 4,880
  • 7
  • 32
  • 47