-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b145
-
generic
-
generic
-
Verified
Minimized test:
===============
$ cat test.java
import java.lang.invoke.*;
public class test {
public static void main(String[] args) throws Throwable {
System.setSecurityManager(new SM());
MethodHandles.lookup().findConstructor(
Ctor.class, MethodType.methodType(void.class));
}
}
class SM extends SecurityManager {
protected SM() { super(); }
}
class Ctor {
Ctor() {}
}
Minimized test output:
======================
$ javac test.java
$ java -verify test
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.invoke.MethodHandles.identity(MethodHandles.java:1593)
at java.lang.invoke.MethodHandleImpl.makeAllocator(MethodHandleImpl.java:107)
at java.lang.invoke.MethodHandles$Lookup.findConstructor(MethodHandles.java:665)
at test.main(test.java:9)
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "sun.invoke.util.ValueConversions.MAX_ARITY" "read")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
at java.security.AccessController.checkPermission(AccessController.java:555)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)
at java.lang.System.getProperty(System.java:706)
at java.lang.Integer.getInteger(Integer.java:887)
at java.lang.Integer.getInteger(Integer.java:844)
at sun.invoke.util.ValueConversions.<clinit>(ValueConversions.java:41)
... 4 more
===============
$ cat test.java
import java.lang.invoke.*;
public class test {
public static void main(String[] args) throws Throwable {
System.setSecurityManager(new SM());
MethodHandles.lookup().findConstructor(
Ctor.class, MethodType.methodType(void.class));
}
}
class SM extends SecurityManager {
protected SM() { super(); }
}
class Ctor {
Ctor() {}
}
Minimized test output:
======================
$ javac test.java
$ java -verify test
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.invoke.MethodHandles.identity(MethodHandles.java:1593)
at java.lang.invoke.MethodHandleImpl.makeAllocator(MethodHandleImpl.java:107)
at java.lang.invoke.MethodHandles$Lookup.findConstructor(MethodHandles.java:665)
at test.main(test.java:9)
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "sun.invoke.util.ValueConversions.MAX_ARITY" "read")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
at java.security.AccessController.checkPermission(AccessController.java:555)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)
at java.lang.System.getProperty(System.java:706)
at java.lang.Integer.getInteger(Integer.java:887)
at java.lang.Integer.getInteger(Integer.java:844)
at sun.invoke.util.ValueConversions.<clinit>(ValueConversions.java:41)
... 4 more