--- a/hotspot/src/share/vm/oops/instanceKlass.cpp Thu Mar 03 19:53:03 2011 -0500
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp Fri Mar 04 14:40:46 2011 -0500
@@ -735,7 +735,12 @@
static int call_class_initializer_impl_counter = 0; // for debugging
methodOop instanceKlass::class_initializer() {
- return find_method(vmSymbols::class_initializer_name(), vmSymbols::void_method_signature());
+ methodOop clinit = find_method(
+ vmSymbols::class_initializer_name(), vmSymbols::void_method_signature());
+ if (clinit != NULL && clinit->has_valid_initializer_flags()) {
+ return clinit;
+ }
+ return NULL;
}
void instanceKlass::call_class_initializer_impl(instanceKlassHandle this_oop, TRAPS) {