langtools/test/tools/javac/TryWithResources/TwrForVariable3.java
changeset 34565 627464b87753
parent 27844 8b5d79870a2f
--- a/langtools/test/tools/javac/TryWithResources/TwrForVariable3.java	Tue Dec 08 21:02:07 2015 +0100
+++ b/langtools/test/tools/javac/TryWithResources/TwrForVariable3.java	Wed Dec 09 14:26:56 2015 +0100
@@ -7,9 +7,16 @@
     public static void main(String... args) {
         TwrForVariable3 v1 = new TwrForVariable3();
         Object v2 = new Object();
+        Object v3 = new Object() {
+            public void close() {
+            }
+        };
 
         try (v2) {
-            fail("no an AutoCloseable");
+            fail("not an AutoCloseable");
+        }
+        try (v3) {
+            fail("not an AutoCloseable although has close() method");
         }
         try (java.lang.Object) {
             fail("not a variable access");