1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/TryWithResources/T7022711.java Mon Feb 28 13:42:24 2011 -0800 1.3 @@ -0,0 +1,20 @@ 1.4 +/* 1.5 + * @test /nodynamiccopyright/ 1.6 + * @bug 7022711 1.7 + * @summary compiler crash in try-with-resources 1.8 + * @compile/fail/ref=T7022711.out -XDrawDiagnostics T7022711.java 1.9 + */ 1.10 + 1.11 +import java.io.*; 1.12 + 1.13 +class T7022711 { 1.14 + public static void main (String args[]) throws Exception { 1.15 + try (DataInputStream is = new DataInputStream(new FileInputStream("x"))) { 1.16 + while (true) { 1.17 + is.getChar(); // method not found 1.18 + } 1.19 + } catch (EOFException e) { 1.20 + } 1.21 + } 1.22 +} 1.23 +