| Summary: | [compiler][null][correlation] incorrect "may be null" around ternary operator | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Walter Harley <eclipse> |
| Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P5 | CC: | stephan.herrmann |
| Version: | 3.3 | Keywords: | helpwanted |
| Target Milestone: | 4.7 M1 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
We do not perform variables correlation (here size and foo), hence this is out of scope for now. 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 *** |
The following code produces "The variable foo may be null": int f(String[] foo) { int size = (foo == null) ? 0 : foo.length; if (size == 0) return 0; return foo.length; // INCORRECT warning "foo may be null" } I know, maybe this is asking too much from flow analysis :-)