Request for Review : 7175464 : entrySetView field is never updated in NavigableSubMap
Paul Sandoz
paul.sandoz at oracle.com
Thu Nov 15 11:11:39 UTC 2012
On Nov 15, 2012, at 11:58 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> On 15/11/2012 05:28, Mike Duigou wrote:
>> This bug appears to have been present as far back as Java 6 when NavigableSet was introduced. I could only check 6u33 but it seems unlikely to have been broken during the course of Java 6 maintenance releases.
>>
>> As these are views which pass through mutation to the parent object I believe there are fewer compatibility concerns than might be expected.
>>
>> Compatibility concern would mostly involve use of the returned entrySetView for synchronization. Previously synchronization on the returned views would have been partially ineffectual because a new view object was returned every time. Sharing the returned views would have synchronized correctly but any other access to the source object either directly or through other views would have led to problems with concurrent modification of the source treemap.
>>
>> In the repaired implementation where a single view object is returned synchronization on the views would now be more effective and prevent concurrent race errors. It's possible that new deadlock conditions might be introduced but this seems unlikely.
>>
>> Mike
> It does look like it has been there from the NS were added.
>
> I think it's safe to fix this and the change looks fine to me.
>
+1
Paul.
More information about the core-libs-dev
mailing list