RFR [10]: 8186517: sun.nio.cs.StandardCharsets$Aliases and ClassMap can be lazily loaded

Xueming Shen xueming.shen at oracle.com
Wed Aug 23 21:21:17 UTC 2017


On 8/23/17, 8:48 AM, Claes Redestad wrote:
>
> On 08/23/2017 04:52 PM, Claes Redestad wrote:
>> We still need to key on the lower-case name in the cache for now:
>>
>
> Or perhaps not. Since we're always loading these three Charset on
> bootstrap now, we might as well initialize them eagerly and bypass
> the cache entirely (but keep this neatly contained in StandardCharset).
>
> This allows us to lazily load the $Cache class too, further reducing
> work done during System.initPhase1:
>
> http://cr.openjdk.java.net/~redestad/8186517/jdk.02/
>
if we go that far :-) shouldn't we simply expose the utf8/8859-1/ascii 
charset
instance directly?
if we go with String.equals then any reason we still need define the 
String constants?
why the signature change in utf8.java for updatePositions()?

sherman


More information about the nio-dev mailing list