4419 #ifdef ASSERT |
4419 #ifdef ASSERT |
4420 bool f = false; |
4420 bool f = false; |
4421 Method* m = k->lookup_method(vmSymbols::finalize_method_name(), |
4421 Method* m = k->lookup_method(vmSymbols::finalize_method_name(), |
4422 vmSymbols::void_method_signature()); |
4422 vmSymbols::void_method_signature()); |
4423 if (m != NULL && !m->is_empty_method()) { |
4423 if (m != NULL && !m->is_empty_method()) { |
4424 f = true; |
4424 f = true; |
4425 } |
4425 } |
4426 assert(f == k->has_finalizer(), "inconsistent has_finalizer"); |
4426 |
|
4427 // Spec doesn't prevent agent from redefinition of empty finalizer. |
|
4428 // Despite the fact that it's generally bad idea and redefined finalizer |
|
4429 // will not work as expected we shouldn't abort vm in this case |
|
4430 if (!k->has_redefined_this_or_super()) { |
|
4431 assert(f == k->has_finalizer(), "inconsistent has_finalizer"); |
|
4432 } |
4427 #endif |
4433 #endif |
4428 |
4434 |
4429 // Check if this klass supports the java.lang.Cloneable interface |
4435 // Check if this klass supports the java.lang.Cloneable interface |
4430 if (SystemDictionary::Cloneable_klass_loaded()) { |
4436 if (SystemDictionary::Cloneable_klass_loaded()) { |
4431 if (k->is_subtype_of(SystemDictionary::Cloneable_klass())) { |
4437 if (k->is_subtype_of(SystemDictionary::Cloneable_klass())) { |