JDK-8256867 : Classes with empty PermittedSubclasses attribute cannot be extended
Type:Bug
Component:hotspot
Sub-Component:runtime
Affected Version:16
Priority:P3
Status:Resolved
Resolution:Fixed
Submitted:2020-11-23
Updated:2020-12-14
Resolved:2020-12-09
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
Currently, if the number_of_classes field in the PermittedSubclasses attribute is zero then the JVM throws a ClassFormatError exception. Instead, no exception should be thrown and the class cannot be extended.
As part of this change, the Class.getPermittedSubclasses() will be changed to return null for non-sealed classes. This will also fix isSealed behavior after JDK-8246778 in some less common, but not rare cases. So I'd re-evaluate to:
ILW=MMM=P3
for the state that will exist after the presumed integration of JDK-8246778.