< prev index next >

src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java

Print this page
@@ -40,10 +40,12 @@
  import sun.invoke.util.VerifyType;
  import sun.invoke.util.Wrapper;
  
  import java.lang.invoke.MethodHandles.Lookup;
  import java.lang.reflect.Array;
+ import java.lang.reflect.Constructor;
+ import java.lang.reflect.Method;
  import java.nio.ByteOrder;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.HashMap;
  import java.util.Iterator;

@@ -1417,15 +1419,49 @@
          }
      }
  
      static {
          SharedSecrets.setJavaLangInvokeAccess(new JavaLangInvokeAccess() {
+ 
+             @Override
+             public MethodHandle privilegedUnreflect(Method method) {
+                 try {
+                     return IMPL_LOOKUP.unreflect(method);
+                 } catch (IllegalAccessException e) {
+                     throw new InternalError(e);
+                 }
+             }
+ 
+             @Override
+             public MethodHandle privilegedUnreflect(Constructor<?> ctor) {
+                 try {
+                     return IMPL_LOOKUP.unreflectConstructor(ctor);
+                 } catch (IllegalAccessException e) {
+                     throw new InternalError(e);
+                 }
+             }
+ 
+             @Override
+             public MethodHandle privilegedFindStatic(Class<?> refc, String name, MethodType type)
+                     throws NoSuchMethodException {
+                 try {
+                     return IMPL_LOOKUP.findStatic(refc, name, type);
+                 } catch (IllegalAccessException e) {
+                     throw new InternalError(e);
+                 }
+             }
+ 
              @Override
              public Object newMemberName() {
                  return new MemberName();
              }
  
+             @Override
+             public Object newMemberName(Method method) {
+                 return new MemberName(method);
+             }
+ 
              @Override
              public String getName(Object mname) {
                  MemberName memberName = (MemberName)mname;
                  return memberName.getName();
              }
< prev index next >