diff -r 025f9a5e6d9c -r c2c7fed86a5e src/share/vm/classfile/classFileParser.cpp --- 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