Community
Participate
Working Groups
Created attachment 254724 [details] The tiny complete eclipse project that demonstrates the bug I have two classes: y.A and x.B: ------------------------------------------------ package y; public class A { private String f = ""; public void setF(String v) { f = v; } public String getF() { return f; } } ------------------------------------------------ package x; import java.util.concurrent.Callable; public class B { public static void dummy(final A p) throws Exception { dummy1(() -> { p.setF("a"); return "b"; }); p.setF("c"); } public static <T> void dummy1(Callable<T> callable) throws Exception { callable.call(); } } ------------------------------------------------ 1. I have Java compiler null analysis On. 2. I set the NonNullByDefault behaviour on in all package-info.java 3. The compiler complains: Null type safety (type annotations): The expression of type 'String' needs unchecked conversion to conform to '@NonNull String' for the 'v' parameter of void A.setF(String v). This happens when all the following conditions are met: 1. Every time after I have 'project clean' called. If I touch the A.java in the editor, the problem disappears. 2. I refer the 'setF' in a lambda expression. If I change the lambda to an anonymous class, the problem disappears. 3. If I have no statements with a call to 'setF' before is is referred in the lambda. For example, if I move the 'p.setF("c");' statement to the beginning of the 'dummy' method, the problem disappears. 4. If the package for the A class ('y' in my example) is alphabetically after the package of the B class ('x' in my example). The whole project is appended to this report. I use eclipse-rcp-mars-R-linux-gtk-x86_64
Thanks, I'll take a look.
Created attachment 254746 [details] Updated version of the previous attachment Class names in the original attachment did not match that in the bug description.
Hi, any progress here?
(In reply to Vladimir Tsichevski from comment #3) > Hi, any progress here? Not yet. See that the bug is scheduled for 4.6 which is still 11 months ahead :)
Stephan, this is already fixed. It is is as duplicate of bug 485465, fixed by commit 5959bbf385fc1f797d392576c0a27049452fc9d1
(In reply to Till Brychcy from comment #5) > Stephan, this is already fixed. > It is is as duplicate of bug 485465, fixed by commit > 5959bbf385fc1f797d392576c0a27049452fc9d1 You're right, thanks for making the connection. FWIW, I tried to reproduce using the batch compiler, but failed. Only a full build in the IDE proved that the bug occurred prior to commit 5959bbf385fc1f797d392576c0a27049452fc9d1 and has been fixed by that commit. *** This bug has been marked as a duplicate of bug 485465 ***
Verified for 4.6 M7 with build I20160425-1300