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 228437 - Dereferencing possible null pointer - not possible null pointer
Summary: Dereferencing possible null pointer - not possible null pointer
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-10 11:43 UTC by Milutin Kristofic
Modified: 2016-01-09 20:27 UTC (History)
1 user (show)

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 Milutin Kristofic 2013-04-10 11:43:12 UTC
Boolean revertValue = revertMap != null ? (Boolean) revertMap.get(TEST) : null; 
      if (Boolean.FALSE.equals(revertValue)) {
          revertMap.remove(TEST);
      }


There is a hint on revertMap.remove(TEST); If revertMap is null, then this branch is never visited.


Product Version: NetBeans IDE Dev (Build 201304082300)
Updates: Updates available to version , NetBeans 7.3 Beta 2
Java: 1.7.0_17; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02
Comment 1 _ gtzabari 2016-01-09 20:27:11 UTC
I can reproduce the same problem under dev build 201512240002. Given:

assert (oldValue == null || oldValue.getType() == newValue.getType()): "oldValue: " + oldValue.getType() + ", newValue: " + newValue.getType();

Netbeans flags "oldValue.getType()" as "Dereferencing possible null pointer" but if "oldValue" is null then the "oldValue.getType()" is never executed.