Skip to content

Commit 8a065ef

Browse files
author
Harold Seigel
committed
8255005: Fix indentation levels in classFileParser.cpp
Reviewed-by: lfoltan, coleenp
1 parent e48016b commit 8a065ef

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

src/hotspot/share/classfile/classFileParser.cpp

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3893,9 +3893,16 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
38933893
class_info_index, CHECK);
38943894
_nest_host = class_info_index;
38953895

3896-
} else if (_major_version >= JAVA_15_VERSION) {
3897-
// Check for PermittedSubclasses tag
3898-
if (tag == vmSymbols::tag_permitted_subclasses()) {
3896+
} else if (_major_version >= JAVA_16_VERSION) {
3897+
if (tag == vmSymbols::tag_record()) {
3898+
if (parsed_record_attribute) {
3899+
classfile_parse_error("Multiple Record attributes in class file %s", THREAD);
3900+
return;
3901+
}
3902+
parsed_record_attribute = true;
3903+
record_attribute_start = cfs->current();
3904+
record_attribute_length = attribute_length;
3905+
} else if (tag == vmSymbols::tag_permitted_subclasses()) {
38993906
if (supports_sealed_types()) {
39003907
if (parsed_permitted_subclasses_attribute) {
39013908
classfile_parse_error("Multiple PermittedSubclasses attributes in class file %s", CHECK);
@@ -3910,23 +3917,9 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
39103917
permitted_subclasses_attribute_start = cfs->current();
39113918
permitted_subclasses_attribute_length = attribute_length;
39123919
}
3913-
cfs->skip_u1(attribute_length, CHECK);
3914-
3915-
} else if (_major_version >= JAVA_16_VERSION) {
3916-
if (tag == vmSymbols::tag_record()) {
3917-
if (parsed_record_attribute) {
3918-
classfile_parse_error("Multiple Record attributes in class file %s", THREAD);
3919-
return;
3920-
}
3921-
parsed_record_attribute = true;
3922-
record_attribute_start = cfs->current();
3923-
record_attribute_length = attribute_length;
3924-
}
3925-
cfs->skip_u1(attribute_length, CHECK);
3926-
} else {
3927-
// Unknown attribute
3928-
cfs->skip_u1(attribute_length, CHECK);
39293920
}
3921+
// Skip attribute_length for any attribute where major_verson >= JAVA_16_VERSION
3922+
cfs->skip_u1(attribute_length, CHECK);
39303923
} else {
39313924
// Unknown attribute
39323925
cfs->skip_u1(attribute_length, CHECK);

0 commit comments

Comments
 (0)