JDK-8219069 : ConcurrrentHashMap set views' removeAll() performance heuristic should be removed
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.concurrent
  • Priority: P4
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2019-02-15
  • Updated: 2019-02-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
The issue with the performance heuristic for AbstractSet.removeAll() is described in JDK-6394757. We now believe this heuristic is incorrect and should be removed. The CollectionView nested class of ConcurrentHashMap has a similar heuristic in its removeAll() implementation. It should be removed too. See JDK-8218945 for a related case in ConcurrentSkipListSet.

This heuristic sometimes causes the "wrong" collection to be iterated. A consequence of this is that removeAll() might not provide a result that's the complement to retainAll().

See linked bugs for examples.
Comments
Filing this and assigning it to you (Martin) to make sure we take care of this after JDK-6394757 is fixed.
15-02-2019