Summary: | [compiler] Local variables not reported as not been initialized when more than 64 locals are defined | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Oliver Wong <owong> | ||||
Component: | Core | Assignee: | Maxime Daniel <maxime_daniel> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | major | ||||||
Priority: | P3 | CC: | hendrik | ||||
Version: | 3.2 | ||||||
Target Milestone: | 3.2 RC2 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Oliver Wong
2006-04-18 12:52:09 EDT
If the source is changed for: public class X { public static void main(String[] args) { int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z; int aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az; int ba, bb, bc, bd, be, bf, bg, bh; //, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz; Object fromToken = null; Object toToken = null; String fromString; if (fromToken != null) { fromString = ""; } String toString; if (toToken != null) { toString = ""; } System.out.println(fromString); System.out.println(toString); } } Then both toString and fromString are reported as not been initialized. If changed to: public class X { public static void main(String[] args) { int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z; int aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az; int ba, bb, bc, bd, be, bf, bg, bh, bi; //, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz; Object fromToken = null; Object toToken = null; String fromString; if (fromToken != null) { fromString = ""; } String toString; if (toToken != null) { toString = ""; } System.out.println(fromString); System.out.println(toString); } } Only fromString is reported as not been initialized. The limit seems to be 64. Could this be related to how the bits are set in the flow context? My mistake: one branch in UnconditionalFlowInfo#mergedWith doesn't complete its job properly. Added FlowAnalysis test #26 (not activated for now). Created attachment 38890 [details]
Patch - under test for now
+1 for 3.2RC2 Fixed and released in HEAD. Verifier pls use the test cases provided by the reporter and/or Olivier, or else FlowAnalysisTest #26. Verified with I20060427-1600 for 3.2RC2 |