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 deleteCharset
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.

-Alan.

Reply via email to