comparison src/share/vm/classfile/classFileParser.cpp @ 2334:dbad0519a1c4

6845426: non-static <clinit> method with no args is called during the class initialization process Summary: Only call <clinit> with ACC_STATIC for classfiles with version > 50 Reviewed-by: acorn, dholmes, coleenp
author kamg
date Fri, 04 Mar 2011 14:40:46 -0500
parents c5a923563727
children 72dee110246f
comparison
equal deleted inserted replaced
2333:f767174aac14 2334:dbad0519a1c4
1614 signature_index, CHECK_(nullHandle)); 1614 signature_index, CHECK_(nullHandle));
1615 Symbol* signature = cp->symbol_at(signature_index); 1615 Symbol* signature = cp->symbol_at(signature_index);
1616 1616
1617 AccessFlags access_flags; 1617 AccessFlags access_flags;
1618 if (name == vmSymbols::class_initializer_name()) { 1618 if (name == vmSymbols::class_initializer_name()) {
1619 // We ignore the access flags for a class initializer. (JVM Spec. p. 116) 1619 // We ignore the other access flags for a valid class initializer.
1620 flags = JVM_ACC_STATIC; 1620 // (JVM Spec 2nd ed., chapter 4.6)
1621 if (_major_version < 51) { // backward compatibility
1622 flags = JVM_ACC_STATIC;
1623 } else if ((flags & JVM_ACC_STATIC) == JVM_ACC_STATIC) {
1624 flags &= JVM_ACC_STATIC | JVM_ACC_STRICT;
1625 }
1621 } else { 1626 } else {
1622 verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle)); 1627 verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle));
1623 } 1628 }
1624 1629
1625 int args_size = -1; // only used when _need_verify is true 1630 int args_size = -1; // only used when _need_verify is true