Cross Reference: TwrOnNonResource.java
xref
: /
openjdk7
/
langtools
/
test
/
tools
/
javac
/
TryWithResources
/
TwrOnNonResource.java
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
608
N/A
/*
608
N/A
* @test /nodynamiccopyright/
839
N/A
* @bug 6911256 6964740 7013420
608
N/A
* @author Joseph D. Darcy
608
N/A
* @summary Verify invalid TWR block is not accepted.
608
N/A
* @
compile
/
fail
-source 6
TwrOnNonResource.java
608
N/A
* @
compile
/
fail
/
ref
=TwrOnNonResource.out -XDrawDiagnostics
TwrOnNonResource.java
608
N/A
*/
608
N/A
608
N/A
class
TwrOnNonResource
{
608
N/A
public
static
void
main
(
String
...
args
) {
608
N/A
try
(
TwrOnNonResource
aonr
=
new
TwrOnNonResource
()) {
608
N/A
System
.
out
.
println
(
aonr
.
toString
());
608
N/A
}
608
N/A
try
(
TwrOnNonResource
aonr
=
new
TwrOnNonResource
()) {
608
N/A
System
.
out
.
println
(
aonr
.
toString
());
608
N/A
}
finally
{;}
608
N/A
try
(
TwrOnNonResource
aonr
=
new
TwrOnNonResource
()) {
608
N/A
System
.
out
.
println
(
aonr
.
toString
());
608
N/A
}
catch
(
Exception
e) {;}
608
N/A
}
608
N/A
608
N/A
/*
608
N/A
* A close method, but the class is <em>not</em> Closeable or
608
N/A
* AutoCloseable.
608
N/A
*/
608
N/A
public
void
close
() {
608
N/A
throw
new
AssertionError
(
"I'm not Closable!"
);
608
N/A
}
608
N/A
}