< prev index next >

src/java.base/share/classes/jdk/internal/access/JavaLangReflectAccess.java

Print this page
*** 24,10 ***
--- 24,13 ---
   */
  
  package jdk.internal.access;
  
  import java.lang.reflect.*;
+ import java.util.Optional;
+ import java.util.function.Function;
+ 
  import jdk.internal.reflect.*;
  
  /** An interface which gives privileged packages Java-level access to
      internals of java.lang.reflect. Use as a last resort! */
  public interface JavaLangReflectAccess {

*** 65,6 ***
--- 68,9 ---
      public boolean isTrustedFinalField(Field f);
  
      /** Returns a new instance created by the given constructor with access check */
      public <T> T newInstance(Constructor<T> ctor, Object[] args, Class<?> caller)
          throws IllegalAccessException, InstantiationException, InvocationTargetException;
+ 
+     /** Cache code model on the reflective method instance (if none is set already). */
+     Optional<?> setCodeModelIfNeeded(Method method, Function<Method, Optional<?>> modelFactory);
  }
< prev index next >