Codereview request for 6898310: (cs) Charset cache lookups should be synchronized
Alan.Bateman at oracle.com
Fri Sep 2 11:34:26 UTC 2011
Rémi Forax wrote:
> Arghhh, next() can return null !
> CharsetProvider provider = ...
> Iterator<Charset> it = provider.charsets();
> Iterator<Charset> it2 = provider.charsets();
> Charset charset = it.next();
> provider.deleteCharset(charset.name(), ...)
> System.out.println(it2.next()); // print null
> even if I'm not sure a lot of CharsetProvider actually calls
> there is a possible bug here.
deleteCharset isn't a public method so I don't think this can happen. I
don't disagree that that the iterator code should be re-written, just
thinking it's separate from fixing the race condition.
More information about the core-libs-dev