< prev index next >

hotspot/src/share/vm/oops/instanceKlass.cpp

Print this page
rev 7520 : 6904403: assert(f == k-&gt;has_finalizer(),&quot;inconsistent has_finalizer&quot;) with debug VM
Summary: Don't assert if one of classes in hierarhy was redefined
Reviewed-by: coleenp, sspitsyn

@@ -437,10 +437,13 @@
   if (constants() != NULL) {
     assert (!constants()->on_stack(), "shouldn't be called if anything is onstack");
     if (!constants()->is_shared()) {
       MetadataFactory::free_metadata(loader_data, constants());
     }
+    // Delete any cached resolution errors for the constant pool
+    SystemDictionary::delete_resolution_error(constants());
+
     set_constants(NULL);
   }
 
   if (inner_classes() != NULL &&
       inner_classes() != Universe::the_empty_short_array() &&

@@ -1567,10 +1570,25 @@
     lookup_mode = skip_overpass;   // Always ignore overpass methods in superclasses
   }
   return NULL;
 }
 
+#ifdef ASSERT
+// search through class hierarchy and return true if this class or
+// one of the superclasses was redefined
+bool InstanceKlass::has_redefined_this_or_super() const {
+  const InstanceKlass* klass = this;
+  while (klass != NULL) {
+    if (klass->has_been_redefined()) {
+      return true;
+    }
+    klass = InstanceKlass::cast(klass->super());
+  }
+  return false;
+}
+#endif
+
 // lookup a method in the default methods list then in all transitive interfaces
 // Do NOT return private or static methods
 Method* InstanceKlass::lookup_method_in_ordered_interfaces(Symbol* name,
                                                          Symbol* signature) const {
   Method* m = NULL;
< prev index next >