diff src/share/vm/classfile/classFileParser.cpp @ 23182:c2c7fed86a5e

6904403: assert(f == k->has_finalizer(),"inconsistent has_finalizer") with debug VM Summary: Don't assert if one of classes in hierarhy was redefined Reviewed-by: coleenp, sspitsyn
author dsamersoff
date Wed, 28 May 2014 07:36:32 -0700
parents bf41eee321e5
children dd9cc155639c 32b682649973 626f594dffa6
line wrap: on
line diff
--- a/src/share/vm/classfile/classFileParser.cpp	Thu Jul 09 11:10:19 2015 -0700
+++ b/src/share/vm/classfile/classFileParser.cpp	Wed May 28 07:36:32 2014 -0700
@@ -4421,9 +4421,15 @@
   Method* m = k->lookup_method(vmSymbols::finalize_method_name(),
                                  vmSymbols::void_method_signature());
   if (m != NULL && !m->is_empty_method()) {
-    f = true;
+      f = true;
   }
-  assert(f == k->has_finalizer(), "inconsistent has_finalizer");
+
+  // Spec doesn't prevent agent from redefinition of empty finalizer.
+  // Despite the fact that it's generally bad idea and redefined finalizer
+  // will not work as expected we shouldn't abort vm in this case
+  if (!k->has_redefined_this_or_super()) {
+    assert(f == k->has_finalizer(), "inconsistent has_finalizer");
+  }
 #endif
 
   // Check if this klass supports the java.lang.Cloneable interface