6904403: assert(f == k->has_finalizer(),"inconsistent has_finalizer") with debug VM

Don't assert if one of classes in hierarhy was redefined

Reviewed-by: coleenp, sspitsyn
This commit is contained in:
Dmitry Samersoff 2014-05-28 07:36:32 -07:00
parent 1a3734cdfa
commit c291efb1df
9 changed files with 273 additions and 4 deletions

View file

@ -4359,9 +4359,15 @@ void ClassFileParser::set_precomputed_flags(instanceKlassHandle k) {
Method* m = k->lookup_method(vmSymbols::finalize_method_name(),
vmSymbols::void_method_signature());
if (m != NULL && !m->is_empty_method()) {
f = true;
f = true;
}
// 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");
}
assert(f == k->has_finalizer(), "inconsistent has_finalizer");
#endif
// Check if this klass supports the java.lang.Cloneable interface