608N/A/*
608N/A * @test /nodynamiccopyright/
839N/A * @bug 6911256 6964740 7013420
608N/A * @author Joseph D. Darcy
608N/A * @summary Verify invalid TWR block is not accepted.
608N/A * @compile/fail -source 6 TwrOnNonResource.java
608N/A * @compile/fail/ref=TwrOnNonResource.out -XDrawDiagnostics TwrOnNonResource.java
608N/A */
608N/A
608N/Aclass TwrOnNonResource {
608N/A public static void main(String... args) {
608N/A try(TwrOnNonResource aonr = new TwrOnNonResource()) {
608N/A System.out.println(aonr.toString());
608N/A }
608N/A try(TwrOnNonResource aonr = new TwrOnNonResource()) {
608N/A System.out.println(aonr.toString());
608N/A } finally {;}
608N/A try(TwrOnNonResource aonr = new TwrOnNonResource()) {
608N/A System.out.println(aonr.toString());
608N/A } catch (Exception e) {;}
608N/A }
608N/A
608N/A /*
608N/A * A close method, but the class is <em>not</em> Closeable or
608N/A * AutoCloseable.
608N/A */
608N/A public void close() {
608N/A throw new AssertionError("I'm not Closable!");
608N/A }
608N/A}