2010-07-17 02:35:24 +00:00
|
|
|
/*
|
|
|
|
* @test /nodynamiccopyright/
|
2011-01-26 01:02:56 +00:00
|
|
|
* @bug 6911256 6964740 7013420
|
2010-07-17 02:35:24 +00:00
|
|
|
* @author Joseph D. Darcy
|
|
|
|
* @summary Verify invalid TWR block is not accepted.
|
|
|
|
* @compile/fail/ref=TwrOnNonResource.out -XDrawDiagnostics TwrOnNonResource.java
|
|
|
|
*/
|
|
|
|
|
|
|
|
class TwrOnNonResource {
|
2023-01-17 04:43:40 +00:00
|
|
|
public static void meth() {
|
2010-07-17 02:35:24 +00:00
|
|
|
try(TwrOnNonResource aonr = new TwrOnNonResource()) {
|
|
|
|
System.out.println(aonr.toString());
|
|
|
|
}
|
|
|
|
try(TwrOnNonResource aonr = new TwrOnNonResource()) {
|
|
|
|
System.out.println(aonr.toString());
|
|
|
|
} finally {;}
|
|
|
|
try(TwrOnNonResource aonr = new TwrOnNonResource()) {
|
|
|
|
System.out.println(aonr.toString());
|
|
|
|
} catch (Exception e) {;}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A close method, but the class is <em>not</em> Closeable or
|
|
|
|
* AutoCloseable.
|
|
|
|
*/
|
|
|
|
public void close() {
|
|
|
|
throw new AssertionError("I'm not Closable!");
|
|
|
|
}
|
|
|
|
}
|