equal
deleted
inserted
replaced
31 * @run main/othervm Test8009222 |
31 * @run main/othervm Test8009222 |
32 */ |
32 */ |
33 |
33 |
34 import java.lang.invoke.MethodHandle; |
34 import java.lang.invoke.MethodHandle; |
35 import java.lang.invoke.MethodHandles; |
35 import java.lang.invoke.MethodHandles; |
|
36 import java.util.Objects; |
36 |
37 |
37 interface Intf { |
38 interface Intf { |
38 static int i = 0; |
39 static int i = 0; |
39 } |
40 } |
40 |
41 |
41 public class Test8009222 { |
42 public class Test8009222 { |
42 public static void main(String[] args) throws Exception { |
43 public static void main(String[] args) throws Exception { |
43 MethodHandles.lookup() |
44 Objects.requireNonNull(MethodHandles.lookup() |
44 .findStaticGetter(Intf.class, "i", int.class) |
45 .findStaticGetter(Intf.class, "i", int.class)); |
45 .getClass(); // null check |
|
46 |
46 |
47 System.out.println("TEST PASSED"); |
47 System.out.println("TEST PASSED"); |
48 } |
48 } |
49 } |
49 } |