RFR [10]: 8186517: sun.nio.cs.StandardCharsets$Aliases and ClassMap can be lazily loaded
Peter Levart
peter.levart at gmail.com
Thu Aug 24 16:41:12 UTC 2017
On 08/24/2017 06:35 PM, Peter Levart wrote:
>
> On 08/24/2017 12:13 AM, Claes Redestad wrote:
>>
>> Why not. If we went as far as to putting them in
>> java.nio.charset.Charset instead,
>> we'd not even load sun...StandardCharsets during typical bootstrap,
>> which would
>> of course make things even better for startup.
>
> Hm... What about aliases? Would you hard-code them in the individual
> Charset classes (UTF_8, US_ASCII, ISO_8859_1)? They are currently
> generated in the body of sun...StandardCharsets.
>
> Regards, Peter
>
...perhaps the generator could be modified to generate a static method
per charset, returning an array of aliases instead of a static final
field. StandardCharsets would become very light then as its <clinit>
would not do much.
Peter
More information about the nio-dev
mailing list