Description
The JVM should not throw a ClassFormatError exception for abstract or non-final classes that have a Record attribute because that check is not in the JVM Specification.
from dlsmith:
'Record' is not one of the critical attributes described in JVMS 4.7. Like 'Signature' and 'Exceptions', it encodes information that is modeled at the language level, but that the JVM runtime ignores. There is some basic structural validation of these attributes, but nothing that mandates a relationship to other class metadata.
Additionally, the JVM skips Record attributes for classes whose super is not java.lang.Record. This also needs to change because it's not in the JVM Specification. The Record attribute should be parsed for these classes.
from dlsmith:
'Record' is not one of the critical attributes described in JVMS 4.7. Like 'Signature' and 'Exceptions', it encodes information that is modeled at the language level, but that the JVM runtime ignores. There is some basic structural validation of these attributes, but nothing that mandates a relationship to other class metadata.
Additionally, the JVM skips Record attributes for classes whose super is not java.lang.Record. This also needs to change because it's not in the JVM Specification. The Record attribute should be parsed for these classes.
Attachments
Issue Links
- relates to
-
JDK-8255560 Class::isRecord should check that the current class is final and not abstract
-
- Resolved
-
-
JDK-8233595 JVM reflection support for records
-
- Closed
-
-
JDK-8246773 JVMS changes for Record Classes
-
- Resolved
-
-
JDK-8257596 Clarify trusted final fields for record classes
-
- Resolved
-
(1 links to)