langtools/test/tools/javac/TryWithResources/BadTwrSyntax.java
author mcimadamore
Mon, 24 Jan 2011 15:44:51 +0000
changeset 8045 df2ca0edfbaa
parent 6148 3a8158299c51
child 8234 5050975e2df0
permissions -rw-r--r--
6968793: issues with diagnostics Summary: several diagnostic improvements Reviewed-by: jjg

/*
 * @test  /nodynamiccopyright/
 * @bug 6911256 6964740
 * @author Joseph D. Darcy
 * @summary Verify bad TWRs don't compile
 * @compile/fail -source 6 BadTwrSyntax.java
 * @compile/fail/ref=BadTwrSyntax.out  -XDrawDiagnostics BadTwrSyntax.java
 */

import java.io.IOException;
public class BadTwrSyntax implements AutoCloseable {
    public static void main(String... args) throws Exception {
        // illegal semicolon ending resources
        try(BadTwr twrflow = new BadTwr();) {
            System.out.println(twrflow.toString());
        }
    }

    public void close() {
        ;
    }
}