RFR: 8196869: Optimize Locale creation

Claes Redestad claes.redestad at oracle.com
Thu Feb 8 00:38:05 UTC 2018


On 2018-02-07 15:23, Claes Redestad wrote:
> - use map.replace to safely update the entry when putIfAbsent returns 
> an object
>   but it points to a cleared value, so that (benign) races to create 
> new Locale objects
>   will canonicalize

turns out the implementation attempted here with map.replace was 
causing certain tests to fail. Seems there are subtle issues here around
establishing a stable equality relationship which may or may not be easy to
resolve, so I reverted back these particular changes to 
LocaleObjectCache from this

I also did some cleanup in BaseLocale based on offline feedback from Paul:




More information about the core-libs-dev mailing list