JDK-8331291 : java.lang.classfile.Attributes class performs a lot of static initializations
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.classfile
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-04-29
  • Updated: 2024-05-27
  • Resolved: 2024-05-24
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 23
23 masterFixed
Related Reports
CSR :  
Description
java.lang.classfile.Attributes has a static field for each predefined AttributeMapper and an extra field PREDEFINED_ATTRIBUTES initialized with a set of the mappers.

Exposing predefined mappers as static fields requires a lot of static initialization in one of the class involved in the JDK bootstrap.

In this enhancement I propose to expose all the mappers in a form of static methods to allow lazy initialization.

Comments
Changeset: cfdc64fc Author: Adam Sotona <asotona@openjdk.org> Date: 2024-05-24 15:58:34 +0000 URL: https://git.openjdk.org/jdk/commit/cfdc64fcb43e3b261dddc6cc6947235a9e76154e
24-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/19006 Date: 2024-04-29 18:48:53 +0000
30-04-2024