Codereview request for 6898310: (cs) Charset cache lookups should be synchronized

Rémi Forax forax at
Fri Sep 2 11:17:46 UTC 2011

On 09/02/2011 12:51 PM, Alan Bateman wrote:
> Xueming Shen wrote:
>> Hi,
>> This is a forward porting. Same fix has been in jdk5/6, and will be 
>> in jdk 7u2 later.
>> The change itself is relative simple. And given its race-condition 
>> nature, no reliable
>> regression test case is provided.
> This looks okay to me.
> -Alan.

Arghhh, next() can return null !

CharsetProvider provider = ...
Iterator<Charset> it = provider.charsets();
Iterator<Charset> it2 = provider.charsets();
Charset charset =;
provider.deleteCharset(, ...)
System.out.println(;   // print null

even if I'm not sure a lot of CharsetProvider actually calls deleteCharset
there is a possible bug here.


More information about the core-libs-dev mailing list