hotspot/src/share/vm/classfile/classFileParser.cpp
changeset 8653 8797d788a4f1
parent 8296 b1c2163e4e59
child 8675 e9fef2a9bef7
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Thu Mar 03 19:53:03 2011 -0500
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Fri Mar 04 14:40:46 2011 -0500
@@ -1616,8 +1616,13 @@
 
   AccessFlags access_flags;
   if (name == vmSymbols::class_initializer_name()) {
-    // We ignore the access flags for a class initializer. (JVM Spec. p. 116)
-    flags = JVM_ACC_STATIC;
+    // We ignore the other access flags for a valid class initializer.
+    // (JVM Spec 2nd ed., chapter 4.6)
+    if (_major_version < 51) { // backward compatibility
+      flags = JVM_ACC_STATIC;
+    } else if ((flags & JVM_ACC_STATIC) == JVM_ACC_STATIC) {
+      flags &= JVM_ACC_STATIC | JVM_ACC_STRICT;
+    }
   } else {
     verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle));
   }