--- old/src/share/vm/classfile/classFileParser.cpp 2015-12-05 15:20:02.658452214 +0100 +++ new/src/share/vm/classfile/classFileParser.cpp 2015-12-05 15:20:01.602452184 +0100 @@ -1717,6 +1717,21 @@ } coll->set_contended_group(group_index); } + // The Accessor-Annotation specifies the field name it + // belongs to. The index of the symbol is later stored in + // the method. + if (id == AnnotationCollector::_method_Accessor_Method) { + u2 group_index = 0; + if (count == 1 + && s_size == (index - index0) // match size + && s_tag_val == *(abase + tag_off) + && member == vmSymbols::value_name()) { + group_index = Bytes::get_Java_u2(abase + s_con_off); + if (_cp->symbol_at(group_index)->utf8_length() != 0) { + coll->set_accessor_field_name(group_index); + } + } + } } } @@ -1757,6 +1772,9 @@ if (_location != _in_method) break; // only allow for methods if (!privileged) break; // only allow in privileged code return _method_HotSpotIntrinsicCandidate; + case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_reflect_Accessor_signature): + if (_location != _in_method) break; // only allow for methods + return _method_Accessor_Method; #if INCLUDE_JVMCI case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_vm_ci_hotspot_Stable_signature): if (_location != _in_field) break; // only allow for fields @@ -1804,6 +1822,9 @@ m->set_hidden(true); if (has_annotation(_method_HotSpotIntrinsicCandidate) && !m->is_synthetic()) m->set_intrinsic_candidate(true); + if (is_accessor()) { + m->set_accessor_field_name(accessor_field_name()); + } } void ClassFileParser::ClassAnnotationCollector::apply_to(instanceKlassHandle k) {