8146556: jdk.dynalink.beans.ClassLinker can avoid using specific lookup and can use publicLookup instead
authorsundar
Wed, 06 Jan 2016 20:19:02 +0530
changeset 34900 96c0c150eb21
parent 34899 425b1198ddf0
child 34901 bba3b9d1c9ea
8146556: jdk.dynalink.beans.ClassLinker can avoid using specific lookup and can use publicLookup instead Reviewed-by: jlaskey
nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassLinker.java
--- a/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassLinker.java	Tue Jan 05 18:40:43 2016 +0530
+++ b/nashorn/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassLinker.java	Wed Jan 06 20:19:02 2016 +0530
@@ -102,7 +102,7 @@
         setPropertyGetter("static", FOR_CLASS, ValidationType.EXACT_CLASS);
     }
 
-    private static final MethodHandle FOR_CLASS = new Lookup(MethodHandles.lookup()).findStatic(StaticClass.class,
+    private static final MethodHandle FOR_CLASS = Lookup.PUBLIC.findStatic(StaticClass.class,
             "forClass", MethodType.methodType(StaticClass.class, Class.class));
 
 }