langtools/test/tools/javac/flow/T8030218/CompileTimeErrorForNonAssignedStaticFieldTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/flow/T8030218/CompileTimeErrorForNonAssignedStaticFieldTest.java Thu Dec 19 21:58:50 2013 +0000
@@ -0,0 +1,29 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8030218
+ * @summary javac, compile time error isn't shown when final static field is not assigned, follow-up
+ * @compile/fail/ref=CompileTimeErrorForNonAssignedStaticFieldTest.out -XDrawDiagnostics CompileTimeErrorForNonAssignedStaticFieldTest.java
+ */
+
+public class CompileTimeErrorForNonAssignedStaticFieldTest {
+ private final static int i;
+
+ public CompileTimeErrorForNonAssignedStaticFieldTest()
+ throws InstantiationException {
+ throw new InstantiationException("Can't instantiate");
+ }
+
+ static class Inner {
+ private final int j;
+ public Inner(int x)
+ throws InstantiationException {
+ if (x == 0) {
+ throw new InstantiationException("Can't instantiate");
+ } else {
+ j = 1;
+ }
+ System.out.println(j);
+ }
+ }
+
+}