Community
Participate
Working Groups
The error marker: "The method @Nullable (someMethod) from (someClass) cannot implement the corresponding method from (someInterface) due to incompatible nullness constraints" has the line location of (someClass). In an ideal world, it would obviously be (someMethod) instead, to allow one to correct the problem more easily by double clicking and jumping to the correct line. This is certainly a minor problem in the larger scheme of things of null analysis, but I thought I'd let you know anyways.
This is blocking the use of @SuppressWarnings("null") in bug 438469.
The sub-optimal error location corresponds to raising a sub-optimal error: instead for reporting "cannot implement ... due to incompatible ..." we should explicitly say: "The return type is incompatible with ...". Technically this means: whenever we do have the AST of the method to complain against, use problemReporter().illegalReturnRedefinition() instead of problemReporter().cannotImplementIncompatibleNullness(). The latter is a fallback for a situation of which I'm not sure whether it can actually occur. To match the same situation for parameter incompatibilities which do not fit the old messages for SE5 null annotations, I added IProblem.IllegalParameterNullityRedefinition. I had to rephrase one existing error message to make it suitable for type annotations, too, which required update to a number of existing tests ... Messages are now: 914 = The return type is incompatible with ''{1}'' returned from {0} (mismatching null constraints) 972 = Illegal redefinition of parameter {0}, inherited method from {1} declares this parameter as ''{2}'' (mismatching null constraints)
Released for 4.5 M1 via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=61133b8c5e6da454f7cea747a5c83744e4b067c9
*** Bug 438397 has been marked as a duplicate of this bug. ***
*** Bug 438469 has been marked as a duplicate of this bug. ***
Verified for Eclipse Mars 4.5 M1 Build id: I20140804-2000