changeset 10926:a389eb33db44

8155977: ObjectInputStream::resolveClass & resolveProxyClass for platform loader Reviewed-by: acorn, alanb, chegar, dfuchs
author mchung
date Thu, 12 May 2016 11:16:16 -0700
parents c4db9d7b2ee1
children 15f3fe264872
files src/share/vm/prims/jvm.cpp
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/prims/jvm.cpp	Wed May 11 11:04:17 2016 +0200
+++ b/src/share/vm/prims/jvm.cpp	Thu May 12 11:16:16 2016 -0700
@@ -3387,14 +3387,14 @@
   return (!access.is_private() && InstanceKlass::cast(current_class)->is_same_class_package(field_class));
 }
 
-// Return the first non-null class loader up the execution stack, or null
-// if only code from the null class loader is on the stack.
+// Return the first user-defined class loader up the execution stack, or null
+// if only code from the bootstrap or platform class loader is on the stack.
 
 JVM_ENTRY(jobject, JVM_LatestUserDefinedLoader(JNIEnv *env))
   for (vframeStream vfst(thread); !vfst.at_end(); vfst.next()) {
     vfst.skip_reflection_related_frames(); // Only needed for 1.4 reflection
     oop loader = vfst.method()->method_holder()->class_loader();
-    if (loader != NULL) {
+    if (loader != NULL && !SystemDictionary::is_platform_class_loader(loader)) {
       return JNIHandles::make_local(env, loader);
     }
   }