Inherit null annotations not working for external annotations? [message #1741422] |
Thu, 25 August 2016 00:06 |
Michael Vorburger Messages: 103 Registered: July 2009 |
Senior Member |
|
|
Hallo Stephan,
Is this a bug or am I dumb and just using it wrong:
It seems to me that Inherit null annotations are not working for external annotations?
In a @NonNullByDefault package (via package-info.java), for equals(Object obj) in https://github.com/vorburger/eclipse-null-eea-augments/blob/master/examples/eclipse/hello/src/main/java/ch/vorburger/nulls/examples/hello/Hello.java, I'm getting a "The default '@NonNull' conflicts with the inherited '@Nullable' annotation in the overridden method from Object", despite having a working external annotation for java.lang.Object#equals() in https://github.com/vorburger/eclipse-null-eea-augments/blob/master/libraries/java/java/lang/Object.eea, and org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled in https://github.com/vorburger/eclipse-null-eea-augments/blob/master/examples/eclipse/hello/.settings/org.eclipse.jdt.core.prefs#L2
If I change equals(Object obj) to equals(@Nullable Object obj) then the error goes away, of course - but I shouldn't have to, right?
I'm pretty certain that it's not just some sort of basic setup issue, because when I Ctrl-Space to auto-insert equals (after removing it), it proposes it with @Nullable - so JDT clearly knows about the external annotation. In fact, that it proposes @Nullable is another (more minor) bug as well I guess - I'd like my code to be the least cluttered possible, so when Inherit null annotations is on, it shouldn't add @Nullable if not required, agreed?
Shall I open a bugzilla about this (these; want one or two) ?
Regards,
M.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03847 seconds