Community
Participate
Working Groups
3.3M3 (I20061102-1715) Considering the aim of bug 157154, here is an example of a false positive, albeit one that's difficult to reason about (since 'x' tracks whether 's1' could be null): public static int compare(String s1, String s2) { int x = 0; x = (s1 == null) ? 1 : 0; x = (x != 0) ? x : s1.compareTo(s2); // s1 may be null reported return x; } (Of course, easily rewritten to remove the warning in this instance).
Thanks for the test case. There is no firm plan as of today to address variables correlation in the JDT Core null analysis feature. This may be reconsidered in the future.
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 ***