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.

Bug 247999 - False "Null Pointer Dereference" hints in conditional expression
Summary: False "Null Pointer Dereference" hints in conditional expression
Status: RESOLVED DUPLICATE of bug 249320
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-17 09:58 UTC by szd
Modified: 2015-11-11 07:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description szd 2014-10-17 09:58:32 UTC
public void foo(Object p) {
	boolean f = p != null;
	System.out.println(f && p.hashCode() != 0);	// false hint: "Dereferencing possible null pointer"
	if(p == null)	// false hint: "Unnecessary test for null - a NullPointerException would already be thrown"
		System.out.println("boo");
}
Comment 1 Svata Dedic 2014-12-12 12:19:01 UTC

*** This bug has been marked as a duplicate of bug 249320 ***
Comment 2 Svata Dedic 2015-11-11 07:39:05 UTC
Fixed in experimental impl.