src/share/vm/classfile/classFileParser.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6845426 Cdiff src/share/vm/classfile/classFileParser.cpp

src/share/vm/classfile/classFileParser.cpp

Print this page
rev 2113 : 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:

*** 1613,1625 **** "Illegal constant pool index %u for method signature in class file %s", signature_index, CHECK_(nullHandle)); Symbol* signature = cp->symbol_at(signature_index); 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; } else { verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle)); } int args_size = -1; // only used when _need_verify is true --- 1613,1627 ---- "Illegal constant pool index %u for method signature in class file %s", signature_index, CHECK_(nullHandle)); Symbol* signature = cp->symbol_at(signature_index); AccessFlags access_flags; ! if (name == vmSymbols::class_initializer_name() && ! (flags & JVM_ACC_STATIC) == JVM_ACC_STATIC) { ! // We ignore the other access flags for a valid class initializer. ! // (JVM Spec 2nd ed., chapter 4.6) ! flags &= JVM_ACC_STATIC | JVM_ACC_STRICT; } else { verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle)); } int args_size = -1; // only used when _need_verify is true
src/share/vm/classfile/classFileParser.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File