| JDK 26 |
|---|
| 26Unresolved |
|
Relates :
|
|
|
Relates :
|
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.
|