RFR: 8331291: java.lang.classfile.Attributes class performs a lot of static initializations

Adam Sotona asotona at openjdk.org
Tue Apr 30 11:56:20 UTC 2024


On Mon, 29 Apr 2024 23:04:38 GMT, Chen Liang <liach at openjdk.org> wrote:

> Nice changes! Remarks
> 
> 1. The `INSTANCE` fields should be declared `final`, still safe for lazy initialization.
> 2. Not from this patch, but the `AttributeStability stability()` overrides can be moved to `AbstractAttributeMapper`, stored in a field, to decrease source code size.
> 3. `AbstractAttributeMapper` might become sealed now that its implementations are no longer anonymous, might move it to be a private nested class of `Attributes` to omit the long list of permits.

Yes, that is part of the plan for today :)

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19006#issuecomment-2084446739


More information about the core-libs-dev mailing list