< prev index next >

test/jdk/java/lang/invoke/ArrayLengthTest.java

Print this page

        

@@ -76,6 +76,11 @@
     @Test(expectedExceptions = NullPointerException.class)
     public void testArrayLengthNPE() {
         MethodHandles.arrayLength(null);
     }
 
+    @Test(expectedExceptions = NullPointerException.class)
+    public void testNullReference() throws Throwable {
+        MethodHandle arrayLength = MethodHandles.arrayLength(String[].class);
+        arrayLength.invokeExact(null);
+    }
 }
< prev index next >