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 245370 - missing case in dereferencing possible null pointer hint
Summary: missing case in dereferencing possible null pointer hint
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks: 249320
  Show dependency tree
 
Reported: 2014-07-03 10:34 UTC by IrianR
Modified: 2015-09-17 01:26 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 IrianR 2014-07-03 10:34:39 UTC
Using the following code:

List test = null;
for (Object linkedDocumentData : test)
{
   //throws NPE not detected by hint.
}
test.add("NPE detected by hint");

The hint shows on the call to the .add method but not on the for loop.

It works as designed using different kinds of for loops, only the "enhanced" for loop breaks.
Comment 1 Svata Dedic 2015-09-11 14:32:52 UTC
Trivial fix for 8.1, keeping as a reference for the reimplementation. Jet-main#8a6eb4b6eeaa
Comment 2 Quality Engineering 2015-09-17 01:26:23 UTC
Integrated into 'main-silver', will be available in build *201509170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8a6eb4b6eeaa
User: Svata Dedic <sdedic@netbeans.org>
Log: #245370: inspect iterations as pointer dereferences