// initializers completion import java.io.*; public class a { { throw new RuntimeException(); } static { try { throw new RuntimeException(); } finally { throw new NullPointerException(); } } } class a2 { { if (1==2) throw new IOException(); } a2() {} } class SocketException extends IOException { } class ConnectException extends SocketException { } class a3 { { if (1==2) throw new SocketException(); } a3() throws ConnectException {} } class b { { if (1==2) throw new SocketException(); } b() throws IOException {} } class a4 { { if (true) { throw new Exception(); } } a4() throws Exception { } } class a5 { int i = f(); int f() throws ClassNotFoundException { return 0; } } class a6 { int i = f(); int f() throws ClassNotFoundException { return 0; } a6() throws ClassNotFoundException { } } class a7 { { try { throw new RuntimeException(); } finally { } } } class MyRuntimeException extends RuntimeException {} class GUIBase { GUIBase () throws MyRuntimeException {} } class GUI extends GUIBase { } class a8 { { assert true; } { assert false; } } class a9 { private static interface AnInterface {} public AnInterface getAnInterface() { return new AnInterface() { { new java.io.FileInputStream("somefile"); } }; } } //////////////////////////////// class BadStatic { static String f() throws ClassNotFoundException { return null; } private static final String FOO = f(); public BadStatic() throws ClassNotFoundException { } } class H { public H() throws FileNotFoundException { } static { if(true) { throw new FileNotFoundException(); } } }