equal
deleted
inserted
replaced
5 */ |
5 */ |
6 public class TwrForVariable3 implements AutoCloseable { |
6 public class TwrForVariable3 implements AutoCloseable { |
7 public static void main(String... args) { |
7 public static void main(String... args) { |
8 TwrForVariable3 v1 = new TwrForVariable3(); |
8 TwrForVariable3 v1 = new TwrForVariable3(); |
9 Object v2 = new Object(); |
9 Object v2 = new Object(); |
|
10 Object v3 = new Object() { |
|
11 public void close() { |
|
12 } |
|
13 }; |
10 |
14 |
11 try (v2) { |
15 try (v2) { |
12 fail("no an AutoCloseable"); |
16 fail("not an AutoCloseable"); |
|
17 } |
|
18 try (v3) { |
|
19 fail("not an AutoCloseable although has close() method"); |
13 } |
20 } |
14 try (java.lang.Object) { |
21 try (java.lang.Object) { |
15 fail("not a variable access"); |
22 fail("not a variable access"); |
16 } |
23 } |
17 try (java.lang) { |
24 try (java.lang) { |