nashorn/src/jdk/internal/dynalink/beans/StaticClassIntrospector.java
changeset 17247 607f6372b21b
parent 16234 86cb162cec6c
child 17249 a2014831ae7a
--- a/nashorn/src/jdk/internal/dynalink/beans/StaticClassIntrospector.java	Thu Apr 25 14:47:17 2013 +0200
+++ b/nashorn/src/jdk/internal/dynalink/beans/StaticClassIntrospector.java	Thu Apr 25 15:31:23 2013 +0200
@@ -84,10 +84,10 @@
 package jdk.internal.dynalink.beans;
 
 import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 import java.util.HashMap;
 import java.util.Map;
+import jdk.nashorn.internal.lookup.Lookup;
 
 class StaticClassIntrospector extends FacetIntrospector {
     StaticClassIntrospector(Class<?> clazz) {
@@ -98,7 +98,7 @@
     Map<String, MethodHandle> getInnerClassGetters() {
         final Map<String, MethodHandle> map = new HashMap<>();
         for(Class<?> innerClass: membersLookup.getInnerClasses()) {
-            map.put(innerClass.getSimpleName(), editMethodHandle(MethodHandles.constant(StaticClass.class,
+            map.put(innerClass.getSimpleName(), editMethodHandle(Lookup.MH.constant(StaticClass.class,
                     StaticClass.forClass(innerClass))));
         }
         return map;
@@ -106,7 +106,11 @@
 
     @Override
     MethodHandle editMethodHandle(MethodHandle mh) {
-        MethodHandle newHandle = MethodHandles.dropArguments(mh, 0, Object.class);
+        return dropReceiver(mh, Object.class);
+    }
+
+    static MethodHandle dropReceiver(final MethodHandle mh, final Class<?> receiverClass) {
+        MethodHandle newHandle = Lookup.MH.dropArguments(mh, 0, receiverClass);
         // NOTE: this is a workaround for the fact that dropArguments doesn't preserve vararg collector state.
         if(mh.isVarargsCollector() && !newHandle.isVarargsCollector()) {
             final MethodType type = mh.type();