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.

To download the current JDK release, click here.
JDK 16
16 b28Fixed
Related Reports
CSR :  
Relates :  
Description
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.
Comments
Changeset: d33a689b Author: Harold Seigel <hseigel@openjdk.org> Date: 2020-12-09 19:07:11 +0000 URL: https://git.openjdk.java.net/jdk/commit/d33a689b
09-12-2020

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.
03-12-2020

ILW = MLM = P4
24-11-2020