For the following code:
interface Foo extends AutoCloseable {
}
javac will, when compiling with -Xlint, emit a slightly misleading/confusing warning:
$ javac -Xlint Foo.java
Foo.java:1: warning: [try] auto-closeable resource Foo has a member method close() that could throw InterruptedException
public interface Foo extends AutoCloseable {
^
1 warning
Given that Foo doesn't even mention close() explicitly the warning is not as helpful as it could/should be.
interface Foo extends AutoCloseable {
}
javac will, when compiling with -Xlint, emit a slightly misleading/confusing warning:
$ javac -Xlint Foo.java
Foo.java:1: warning: [try] auto-closeable resource Foo has a member method close() that could throw InterruptedException
public interface Foo extends AutoCloseable {
^
1 warning
Given that Foo doesn't even mention close() explicitly the warning is not as helpful as it could/should be.
- relates to
-
JDK-7027362 Project Coin: warn of throwing InterruptedException in AutoCloseable.close javadoc
- Closed
-
JDK-7027157 Project Coin: javac warnings for AutoCloseable.close throwing InterruptedException
- Closed