1/* 2 * @test /nodynamiccopyright/ 3 * @bug 4718142 4 * @summary DU analysis not conservative for try-finally 5 * @author Neal Gafter (gafter) 6 * 7 * @compile/fail/ref=T4718142.out -XDrawDiagnostics T4718142.java 8 */ 9 10class T4718142 { 11 static class E extends Exception {} 12 static void thr() throws E { 13 throw new E(); 14 } 15 public static void main(String[] args) { 16 int count = 0; 17 final int i; 18 while (true) { 19 try { 20 i = count++; 21 System.out.println("assigned " + i); 22 thr(); 23 while (true) {} 24 } catch (E e) {} 25 } 26 } 27} 28