Community
Participate
Working Groups
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"))
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.
Reopening as P5 (since RESOLVED LATER is deprecated).
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.
Verified for 4.7 M1
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 ***