src/share/vm/classfile/classFileParser.cpp

changeset 2616
dbad0519a1c4
parent 2533
c5a923563727
child 2638
72dee110246f
     1.1 --- a/src/share/vm/classfile/classFileParser.cpp	Thu Mar 03 19:53:03 2011 -0500
     1.2 +++ b/src/share/vm/classfile/classFileParser.cpp	Fri Mar 04 14:40:46 2011 -0500
     1.3 @@ -1616,8 +1616,13 @@
     1.4  
     1.5    AccessFlags access_flags;
     1.6    if (name == vmSymbols::class_initializer_name()) {
     1.7 -    // We ignore the access flags for a class initializer. (JVM Spec. p. 116)
     1.8 -    flags = JVM_ACC_STATIC;
     1.9 +    // We ignore the other access flags for a valid class initializer.
    1.10 +    // (JVM Spec 2nd ed., chapter 4.6)
    1.11 +    if (_major_version < 51) { // backward compatibility
    1.12 +      flags = JVM_ACC_STATIC;
    1.13 +    } else if ((flags & JVM_ACC_STATIC) == JVM_ACC_STATIC) {
    1.14 +      flags &= JVM_ACC_STATIC | JVM_ACC_STRICT;
    1.15 +    }
    1.16    } else {
    1.17      verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle));
    1.18    }

mercurial