When I use the Java 8 method reference double colon operator (::
) with new operator (e.g. MyType::new
), I get this error in Eclipse of Spring Tool suite (STS):
The type org.eclipse.jdt.annotation.NonNull cannot be resolved. It is indirectly referenced from required .class files
How to get rid of this error?