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 236940

Summary: Wrong Warning - Dereferencing null pointer on assertion
Product: java Reporter: Pesso
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED WONTFIX    
Severity: normal CC: mklaehn
Priority: P4    
Version: 7.3.1   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: NetBeans screenshot

Description Pesso 2013-10-09 12:23:18 UTC
Created attachment 140943 [details]
NetBeans screenshot

This code raises the "dereferencing null pointer" warning on line 2:

    Object o = null;
    assert o == null : o.toString();

If I'm not wrong, the "o.toString()" should be called only if the assertion is false, i.e. if o != null.
Is this correct?
Thanks!
Comment 1 Jiri Prox 2013-10-11 06:41:49 UTC
reproducible
Comment 2 Jiri Prox 2013-12-17 15:03:22 UTC
*** Bug 239560 has been marked as a duplicate of this bug. ***
Comment 3 Martin Balin 2016-07-07 07:18:09 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss