Summary: | [compiler] uninitialized variable not reported in if (false) block | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Christopher Sahnwaldt <jcsahnwaldt> | ||||
Component: | Core | Assignee: | Maxime Daniel <maxime_daniel> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | jcsahnwaldt, philippe_mulet | ||||
Version: | 3.2.1 | ||||||
Target Milestone: | 3.2.2 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Christopher Sahnwaldt
2006-12-04 10:30:31 EST
Maxime - pls show me the patch once available. Feels to me like a regression. NOTE: this code must not yield an error. We should thus distinguish based on the scope of the variable (defined within/outside fake reachable code). public class X { public static void main(String[] args) { String string; if (false) { System.out.println(string); } } } Need to also check subscopes scenarii (where more than one level of scope is defined within fake reachable land). Released FlowAnalysisTest#37 (inactive) and 38. All javac levels behave the same. Created attachment 55031 [details]
Suggested fix + test cases
Suggested fix (under test) checks if the declaration is within reachable code.
Added test cases for the final locals, for which our behavior was OK.
Released for 3.3 M4. Maxime - pls backport to 3.2.2. Released for 3.2.2. Verified for 3.3M4 with I20061211-1119 by Olivier at 2006-12-11 Verified for 3.2.2 using build M20070112-1200 |