Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 155043 - More intelligent null dereference analysis needed
Summary: More intelligent null dereference analysis needed
Status: RESOLVED DUPLICATE of bug 136676
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-24 10:40 EDT by Nils Kilden-Pedersen CLA
Modified: 2006-08-24 13:07 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nils Kilden-Pedersen CLA 2006-08-24 10:40:16 EDT
Example:

01      MyClass value = map.get(key);
02      final boolean newValue = (value == null); 
03      if(newValue) {
04          value = new MyClass();
05      } else {
06          value.reset();
07      }
08      // Do something to value here
09      if(newValue) {
10          map.put(key, value);
11      }


This leads to a "The variable value may be null" warning on line 06.
Comment 1 Maxime Daniel CLA 2006-08-24 13:07:58 EDT
A variant of bug 136676 (a final boolean controls the null status of another variable).

*** This bug has been marked as a duplicate of 136676 ***