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.
Summary: | Dereferencing null pointer hint fails when not using short circuit operands | ||
---|---|---|---|
Product: | java | Reporter: | dktcoding |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | NO74, USABILITY |
Priority: | P3 | ||
Version: | 7.4 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
dktcoding
2013-10-30 03:30:00 UTC
reproducible An additional defect: boolean foo = array1 != null; if (array.length == 1) { // <- a warning appears, provoked by array1 != null. } speculative values created by == and != comparison operators leak to a permanent variable state set. OK, correction ;) Lahvac reminded me that != or == may be seen as a hint that the programmer supposes the value *might* be sometimes null; so values which are subject to != or == operator should be checked as if null was a possible value. So my example is incorrect - not a bug. |