< prev index next >

src/java.base/share/classes/java/lang/reflect/ReflectAccess.java

Print this page
*** 26,10 ***
--- 26,13 ---
  package java.lang.reflect;
  
  import jdk.internal.access.JavaLangReflectAccess;
  import jdk.internal.reflect.ConstructorAccessor;
  
+ import java.util.Optional;
+ import java.util.function.Function;
+ 
  /** Package-private class implementing the
      jdk.internal.access.JavaLangReflectAccess interface, allowing the java.lang
      package to instantiate objects in this package. */
  final class ReflectAccess implements JavaLangReflectAccess {
      public <T> Constructor<T> newConstructorWithAccessor(Constructor<T> original, ConstructorAccessor accessor) {

*** 76,6 ***
--- 79,11 ---
      public <T> T newInstance(Constructor<T> ctor, Object[] args, Class<?> caller)
          throws IllegalAccessException, InstantiationException, InvocationTargetException
      {
          return ctor.newInstanceWithCaller(args, true, caller);
      }
+ 
+     @Override
+     public Optional<?> setCodeModelIfNeeded(Method method, Function<Method, Optional<?>> modelFactory) {
+         return method.setCodeModelIfNeeded(modelFactory);
+     }
  }
< prev index next >