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.
private int doStuffTernaryGood(final Collection<Object> objects) { return ((null != objects) && !objects.isEmpty()) ? objects.iterator().next().hashCode() : 0; } the above works as expected. If on the other hand the condition is the complement as in the folowing code private int doStuffTernaryBad(final Collection<Object> objects) { return ((null == objects) || objects.isEmpty()) ? 0 : objects.iterator().next().hashCode(); } objects.iterator() is marked with a hint of "Dereferencing null pointer".
Integrated into 'main-golden', will be available in build *201211040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/508e3c0500c4 User: Jan Lahoda <jlahoda@netbeans.org> Log: #221350: handle conditional expression similarly to ifs.
Fixed by the above changeset, thanks for the report.
verified with Product Version: NetBeans IDE Dev (Build nbms-and-javadoc-9532-on-20121106) Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b13