Community
Participate
Working Groups
I20080604-2000 On the following test case, Eclipse complains that i may remain uninitialized, while javac is silent: public class X { final int i; X() { if (true) { throw new NullPointerException(); } } } Note that both keep quiet on the following: public class X { X() { final int i; if (true) { throw new NullPointerException(); } System.out.println(i); } } Added FlowAnalysisTest#50 & 51.
class Y { Y(Object o) { } } public class X extends Y { final int blank; { if (true) throw new NullPointerException(); } X() { super(new Object() {}); } } elicits an error from us, but not from javac (5/6/7) This behavior is codified by us in org.eclipse.jdt.core.tests.compiler.regression.FlowAnalysisTest.test031()
Created attachment 154536 [details] Proposed patch Proposed fix and tests
Released in HEAD for 3.6M5
Verified for 3.6M5 using I20100125-0800