RFR: 8145351: test/java/text/Format/DateFormat/Bug8141243.java fails in jake b96

Alan Bateman Alan.Bateman at oracle.com
Wed Jan 6 09:48:36 UTC 2016



On 06/01/2016 06:40, Masayoshi Okutsu wrote:
> On 1/5/2016 10:38 PM, Alan Bateman wrote:
>>
>> One other question on this is whether there are concurrency issues 
>> with the candidate list? I ask because candidateMap is a CHM but the 
>> map value (the candidate list) seems to be queried (via the size 
>> method) and updated in getCandidateLocale without any 
>> synchronization. Is this a concern?
>
> The candidate list (candidates) won't be modified once it's been put 
> in candidatesMap. Are you referring to some other case?
I should have been clearer. Suppose two threads invoke 
LocaleDataStrategy's getCandidateLocales at round the same time. There 
is no entry in the candidateMap so get will get the list of candidates 
via the adpater or default control getCandidateLocales. If I read the 
code correctly then they will both mutate this list and then race to add 
it to the candidateMap. So maybe my question is really about the return 
from adpater or default control getCandidateLocales - is it okay to 
mutable this list, maybe these methods already return a new List?

-Alan


More information about the jigsaw-dev mailing list