< prev index next >

src/hotspot/share/prims/jvmtiRedefineClasses.cpp

Print this page

        

@@ -142,12 +142,13 @@
       _res = JVMTI_ERROR_NULL_POINTER;
       return false;
     }
 
     oop mirror = JNIHandles::resolve_non_null(_class_defs[i].klass);
-    // classes for primitives and arrays and vm unsafe anonymous classes cannot be redefined
-    // check here so following code can assume these classes are InstanceKlass
+    // classes for primitives, arrays, nonfindable and vm unsafe anonymous classes
+    // cannot be redefined.  Check here so following code can assume these classes
+    // are InstanceKlass.
     if (!is_modifiable_class(mirror)) {
       _res = JVMTI_ERROR_UNMODIFIABLE_CLASS;
       return false;
     }
   }

@@ -288,12 +289,13 @@
   // classes for arrays cannot be redefined
   if (k == NULL || !k->is_instance_klass()) {
     return false;
   }
 
-  // Cannot redefine or retransform an unsafe anonymous class.
-  if (InstanceKlass::cast(k)->is_unsafe_anonymous()) {
+  // Cannot redefine or retransform a nonfindable or an unsafe anonymous class.
+  if (InstanceKlass::cast(k)->is_nonfindable() ||
+      InstanceKlass::cast(k)->is_unsafe_anonymous()) {
     return false;
   }
   return true;
 }
 

@@ -1174,10 +1176,11 @@
     InstanceKlass* scratch_class = SystemDictionary::parse_stream(
                                                       the_class_sym,
                                                       the_class_loader,
                                                       protection_domain,
                                                       &st,
+                                                      NULL, // dynamic_nest_host
                                                       THREAD);
     // Clear class_being_redefined just to be sure.
     state->clear_class_being_redefined();
 
     // TODO: if this is retransform, and nothing changed we can skip it
< prev index next >