1 /* 2 * @test /nodynamiccopyright/ 3 * @bug 6911256 6964740 6965277 4 * @author Maurizio Cimadamore 5 * @summary Resource of a type-variable type crashes Flow 6 * @compile ResourceTypeVar.java 7 */ 8 9 class ResourceTypeVar<X extends AutoCloseable> { 10 11 public void test() { 12 try(X armflow = getX()) { 13 //do something 14 } catch (Exception e) { // Not reachable 15 throw new AssertionError("Shouldn't reach here", e); 16 } 17 } 18 19 X getX() { return null; } 20 }