jdk/test/java/lang/invoke/8009222/Test8009222.java
changeset 29094 a4fd2b5e49f8
parent 16484 f24cb2927b7a
child 40684 2e37c119dc2a
equal deleted inserted replaced
29057:d6224d602145 29094:a4fd2b5e49f8
    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 }