* @author Joseph D. Darcy * @summary Verify invalid TWR block is not accepted. * @compile/fail -source 6 TwrOnNonResource.java * @compile/fail/ref=TwrOnNonResource.out -XDrawDiagnostics TwrOnNonResource.java */classTwrOnNonResource{publicstaticvoidmain(String...args){try(TwrOnNonResourceaonr=newTwrOnNonResource()){System.out.println(aonr.toString());}try(TwrOnNonResourceaonr=newTwrOnNonResource()){System.out.println(aonr.toString());}finally{;}try(TwrOnNonResourceaonr=newTwrOnNonResource()){System.out.println(aonr.toString());}catch(Exceptione){;}}/* * A close method, but the class is <em>not</em> Closeable or * AutoCloseable. */publicvoidclose(){thrownewAssertionError("I'm not Closable!");}}