Webrev:
  http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8157464/webrev.00/index.html

StackWalker::getCallerClass() is specified to return the invoker of the 
MethodHandle and java.lang.reflect.Method for the method calling 
StackWalker::getCallerClass().

StackWalker::getCallerClass() is not used by any @CallerSensitive method.  
Instead one intended usage of StackWalker::getCallerClass() is to be called by 
library code acting as an agent that calls @CallerSensitive method on behalf of 
the true caller and typically it will call an appropriate method with the 
appropriate parameter (e.g. ResourceBundle.getBundle(String, ClassLoader).

MethodHandle for @CS method behaves as if the caller is the lookup class.  The 
actual caller class may not be the lookup class which is left as implementation 
details.  This patch adjusts the stack walker to return the same caller as 
jdk.internal.reflect.Reflection::getCallerClass.

Mandy



Reply via email to