< prev index next >

src/hotspot/share/classfile/classFileParser.cpp

Print this page

        

@@ -3713,11 +3713,12 @@
           check_property(
                          valid_klass_reference_at(class_info_index),
                          "Nest-host class_info_index %u has bad constant type in class file %s",
                          class_info_index, CHECK);
           _nest_host = class_info_index;
-        } else if (tag == vmSymbols::tag_record()) {
+        } else if (_major_version >= JAVA_14_VERSION) {
+          if (tag == vmSymbols::tag_record()) {
           // Skip over Record attribute if not supported or if super class is
           // not java.lang.Record.
           if (supports_records() &&
               cp->klass_name_at(_super_class_index) == vmSymbols::java_lang_Record()) {
             if (parsed_record_attribute) {

@@ -3735,10 +3736,14 @@
         } else {
           // Unknown attribute
           cfs->skip_u1(attribute_length, CHECK);
         }
       } else {
+          // Unknown attribute
+          cfs->skip_u1(attribute_length, CHECK);
+        }
+      } else {
         // Unknown attribute
         cfs->skip_u1(attribute_length, CHECK);
       }
     } else {
       // Unknown attribute
< prev index next >