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

Ulf Zibis Ulf.Zibis at gmx.de
Fri Sep 2 11:40:01 UTC 2011


Sherman, IMHO, synchronizing multiple call site does NOT look good to me.
On next chance, someone other calls lookup() without knowing, that it has to be synchronized.
Please simply synchronize lookup() itself, maybe in sophisticated way (only the necessary part of 
the code).
The same seems to count for init().
(don't know if synchronised would apply on abstract methods, but in any way on it's implementation):
     protected synchronized void init() {}

-Ulf


Am 01.09.2011 20:42, schrieb Xueming Shen:
> Hi,
>
> This is a forward porting. Same fix has been in jdk5/6, and will be in jdk 7u2 later.
>
> http://cr.openjdk.java.net/~sherman/6898310/webrev
>
> The change itself is relative simple. And given its race-condition nature, no reliable
> regression test case is provided.
>
> Thanks!
>
> -Sherman
>



More information about the core-libs-dev mailing list