2010-07-16 19:35:24 -07:00
|
|
|
/*
|
|
|
|
* @test /nodynamiccopyright/
|
|
|
|
* @bug 6911256 6964740
|
|
|
|
* @author Joseph D. Darcy
|
|
|
|
* @summary Verify bad TWRs don't compile
|
2015-05-15 01:36:32 -07:00
|
|
|
* @compile/fail/ref=BadTwrSyntax6.out -XDrawDiagnostics -source 6 BadTwrSyntax.java
|
2011-01-31 19:06:32 -08:00
|
|
|
* @compile/fail/ref=BadTwrSyntax.out -XDrawDiagnostics BadTwrSyntax.java
|
2010-07-16 19:35:24 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
public class BadTwrSyntax implements AutoCloseable {
|
|
|
|
public static void main(String... args) throws Exception {
|
2011-01-31 19:06:32 -08:00
|
|
|
// illegal double semicolon ending resources
|
|
|
|
try(BadTwr twrflow = new BadTwr();;) {
|
|
|
|
System.out.println(twrflow.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
// but one semicolon is fine
|
2010-07-16 19:35:24 -07:00
|
|
|
try(BadTwr twrflow = new BadTwr();) {
|
|
|
|
System.out.println(twrflow.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void close() {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
}
|