1 /* 2 * @test /nodynamiccopyright/ 3 * @bug 4630634 4 * @summary missing warn about exception not thrown in try block if finally can't complete 5 * @author gafter 6 * 7 * @compile/fail/ref=ExceptionalFinally2.out -XDrawDiagnostics ExceptionalFinally2.java 8 */ 9 10 class ExceptionalFinally2 { 11 static class E extends Exception {} 12 t()13 public void t() throws E {} 14 f()15 void f() { 16 try { 17 try { 18 t(); 19 } finally { 20 return; 21 } 22 } catch (E x) { // error: E can't be thrown in try block 23 } 24 } 25 } 26