This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Consider this piece of code: Object o = null; if ((o != null) ^ false) { // ^ false is a NOP throw new RuntimeException(); } if (o == null) { // NetBeans: "Unnecessary test for null - the expression is never null" } NetBeans says "the expression is never null" but, on the contrary, it is always null.
Also note that the wrong hint disappears if you remove the bitwise XOR from the first "if" statement. Perhaps this bug is related to https://netbeans.org/bugzilla/show_bug.cgi?id=249234
Will be fixed as part of issue #249320
*** This bug has been marked as a duplicate of bug 245201 ***
Fixed in experimental impl, wait for the umbrella issue to close.