langtools/test/tools/javac/TryWithResources/T7022711.java
author sogoel
Thu, 05 Jun 2014 10:57:10 -0700
changeset 24797 850ebd4d80a7
parent 8620 0b04e5235f25
child 34565 627464b87753
permissions -rw-r--r--
8044072: Group 2: create .out files for OverrideChecks tests in tools/javac dir Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8620
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
     1
/*
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
     3
 * @bug 7022711
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
     4
 * @summary compiler crash in try-with-resources
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
     5
 * @compile/fail/ref=T7022711.out -XDrawDiagnostics T7022711.java
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
     6
 */
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
     7
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
     8
import java.io.*;
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
     9
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    10
class T7022711 {
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    11
    public static void main (String args[]) throws Exception {
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    12
        try (DataInputStream is = new DataInputStream(new FileInputStream("x"))) {
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    13
            while (true) {
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    14
                is.getChar();  // method not found
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    15
            }
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    16
        } catch (EOFException e) {
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    17
        }
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    18
    }
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    19
}
0b04e5235f25 7022711: compiler crash in try-with-resources
jjg
parents:
diff changeset
    20