Community
Participate
Working Groups
My Eclipse version is 3.2.0 build ID is I20060217-1115. Here's a test code: <code> public class TestCase { 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); } } } </code> If you try to compile this with Sun's JavaC, it reports two compile errors saying that fromString and toString might not have been initialized when the println() occurs. If you put this into Eclipse, Eclipse will compile it, and when you try to run the class file produced by Eclipse, the JVM will throw an java.lang.Verify error. It looks like Eclipse "stops checking" when you declare too many variables. These can be local variables, or fields of the class. Try commenting out some of the useless variable declarations, and Eclipse will correctly detect that the two strings are uninitialized.
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