8179424: Remove terminally deprecated sun.reflect.Reflection.getCallerClass

Reviewed-by: alanb, dfuchs, dholmes, lancea, mchung, rriggs
This commit is contained in:
Chris Hegarty 2017-12-22 15:55:29 +00:00
parent df559fe00e
commit a2000f8720
13 changed files with 22 additions and 247 deletions

View file

@ -678,17 +678,9 @@ JVM_END
// Misc. class handling ///////////////////////////////////////////////////////////
JVM_ENTRY(jclass, JVM_GetCallerClass(JNIEnv* env, int depth))
JVM_ENTRY(jclass, JVM_GetCallerClass(JNIEnv* env))
JVMWrapper("JVM_GetCallerClass");
// Pre-JDK 8 and early builds of JDK 8 don't have a CallerSensitive annotation; or
// sun.reflect.Reflection.getCallerClass with a depth parameter is provided
// temporarily for existing code to use until a replacement API is defined.
if (SystemDictionary::reflect_CallerSensitive_klass() == NULL || depth != JVM_CALLER_DEPTH) {
Klass* k = thread->security_get_caller_class(depth);
return (k == NULL) ? NULL : (jclass) JNIHandles::make_local(env, k->java_mirror());
}
// Getting the class of the caller frame.
//
// The call stack at this point looks something like this: