test/tools/javac/TryWithResources/BadTwrSyntax.java
Print this page
@@ -8,11 +8,16 @@
*/
import java.io.IOException;
public class BadTwrSyntax implements AutoCloseable {
public static void main(String... args) throws Exception {
- // illegal semicolon ending resources
+ // illegal double semicolon ending resources
+ try(BadTwr twrflow = new BadTwr();;) {
+ System.out.println(twrflow.toString());
+ }
+
+ // but one semicolon is fine
try(BadTwr twrflow = new BadTwr();) {
System.out.println(twrflow.toString());
}
}