hotspot/src/share/vm/oops/instanceKlass.cpp
changeset 8653 8797d788a4f1
parent 8297 f05d10c1c4b8
child 8676 9098d4e927e1
--- 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) {