Bug 129076 - [compiler][null][correlation] instanceof result stored in a boolean not considered
Summary: [compiler][null][correlation] instanceof result stored in a boolean not consi...
Status: CLOSED DUPLICATE of bug 538421
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: 4.7 M1   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2006-02-22 17:40 EST by Thomas Hallgren CLA
Modified: 2018-08-30 10:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hallgren CLA 2006-02-22 17:40:59 EST
The following code yields a null reference warning:

boolean isFoo = (bi instanceof Foo);
if(isFoo)
{
    if(((Foo)bi).getName().equals("xyz"))

but this doesn't:

if(bi instanceof Foo)
{
    if(((Foo)bi).getName().equals("xyz"))
Comment 1 Maxime Daniel CLA 2006-03-23 08:22:06 EST
There is no attempt so far to correlate variables status (beyond direct assignment of the one to the other). Accordingly, the current implementation does not remember any relationship between isFoo and the null status of bi.

We may consider variables correlation post 3.2.
Comment 2 Maxime Daniel CLA 2007-06-19 08:06:24 EDT
Reopening as P5 (since RESOLVED LATER is deprecated).
Comment 3 Stephan Herrmann CLA 2016-06-28 17:18:02 EDT
Bulk closing all compiler bugs tagged [null][correlation], because we have no plans to add such a feature: it would be a tremendous implementation effort, beyond our current man power, and may be impossible to achieve within the desired performance bounds.

If s.o. has a viable strategy or even implementation for such a feature, I'm all ears.
Comment 4 Sasikanth Bharadwaj CLA 2016-08-02 04:38:32 EDT
Verified for 4.7 M1
Comment 5 Stephan Herrmann CLA 2018-08-30 10:37:32 EDT
I created a new umbrella RFE outlining what would be needed to address this issue.

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