Summary: | Redundant null check false-positive | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Boris <a613265> | ||||
Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | minor | ||||||
Priority: | P3 | CC: | Brian.Miller, Olivier_Thomann | ||||
Version: | 3.6 | Flags: | Olivier_Thomann:
review+
|
||||
Target Milestone: | 3.6 M7 | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Boris
2010-03-11 15:44:21 EST
Ayushman, could you please have a look? Created attachment 161856 [details]
proposed fix v1.0 + regression tests
Its a case where we were recording the null reference (via FlowContext#recordUsingNullReference()) before the assignment expression was analyzed. And hence at the time of giving out the warning, the flowInfo was still unaware of the assignment.
The above fix simply makes sure that the expression inside instanceof statement gets analyzed first, the null info and initializations saved into flowInfo, and then only the null references are recorded.
Patch looks good. Released for 3.6M7. Regression test added in: org.eclipse.jdt.core.tests.compiler.regression.NullReferenceTest#testBug305590 Verified for 3.6M7 using I20100425-2000 *** Bug 242131 has been marked as a duplicate of this bug. *** |