| Summary: | [compiler][null] boxed boolean reported as potentially null after null test in lazy disjunction | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Patrice Chalin <chalin> |
| Component: | Core | Assignee: | Stephan Herrmann <stephan.herrmann> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | chalin, jarthana, martijn.dashorst, shankhba, stephan.herrmann |
| Version: | 4.3.1 | ||
| Target Milestone: | 4.4 M7 | ||
| Hardware: | All | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
Thanks for the test, Patrice. I have a simple fix under test. Test & fix released for 4.4 M7 via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=a6d7d17b7bc9c61b1990ed86d94864463a8a31d4 Verified for 4.4 M7 with build I20140430-0800 *** Bug 415866 has been marked as a duplicate of this bug. *** |
Consider the code given below. Note the spurious potential NPE reported at (*). import org.jmlspecs.annotation.NonNullByDefault; import org.jmlspecs.annotation.Nullable; import org.junit.Test; @NonNullByDefault public class NullExprTest { private @Nullable Boolean b() { return null; } @Test public void testBoolean() { Boolean b1 = b(); boolean b = b1 == null || b1; // <-- reports potential NPE (*) org.junit.Assert.assertTrue(b); } }