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

Peter Levart peter.levart at gmail.com
Thu Aug 24 11:03:37 UTC 2017

Hi Claes,

On 08/23/2017 05:48 PM, Claes Redestad wrote:
> http://cr.openjdk.java.net/~redestad/8186517/jdk.02/

I see you put @Stable on some fields of StandardCharset. So that they 
would be constant-folded by JIT. But this would only work if the 
instance of StandardCharset was constant-folded too. For this to work, 
the field in java.nio.charset.Charset:

     /* The standard set of charsets */
     private static CharsetProvider standardProvider = new 

...would have to be declared static final. Which is easy to fix - 
probably an oversight.

Regards, Peter

More information about the nio-dev mailing list