JDK 9 RFR of 8039474: sun.misc.CharacterDecoder.decodeBuffer should use getBytes(iso8859-1)

Xueming Shen xueming.shen at oracle.com
Thu Apr 10 15:20:38 UTC 2014


Looks fine. Personally I would prefer the "canonicalized/real"  name 
"ISO-8859-1" though.

-Sherman

On 4/10/14 7:57 AM, Brian Burkhalter wrote:
> On Apr 10, 2014, at 3:27 AM, Ulf Zibis <Ulf.Zibis at CoSoCo.de> wrote:
>
>> Correction ...
>>
>> Am 10.04.2014 12:03, schrieb Ulf Zibis:
>>> Hi Chris,
>>>
>>> Am 10.04.2014 11:04, schrieb Chris Hegarty:
>>>> Trivially, you could ( but of not have to ) use java.nio.charset.StandardCharsets.ISO_8859_1 to avoid the cost of String to CharSet lookup.
>>> In earlier tests Sherman and I have found out, that the cost of initialization of a new charsets object is higher than the lookup of an existing object in the cache.
>>> And it's even better to use the same String instance for the lookup which was used to cache the charset.
>> It's not about the cached charset, but about the cached charsets de/encoder, compare:
>>     StringCoding.decode(String charsetName, byte[] ba, int off, int len)
>>     StringCoding.decode(Charset cs, byte[] ba, int off, int len)
> So from all this I infer that the change is OK as-is.
>
> Correct?
>
> Thanks,
>
> Brian




More information about the core-libs-dev mailing list