JDK-8180348 : AbstractSet.removeAll does not specify the case when collections are the same size
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2017-05-12
  • Updated: 2018-09-11
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
A DESCRIPTION OF THE PROBLEM :
The documentation describes the behavior when this collection size is larger and when the other collection size is larger but does not describe the behavior when the sizes are the same.

I mitigated the problem by looking at the implementation.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The documentation should describe the behavior when the collection sizes are the same. This is important because the iteration algorithm significantly affects performance.
ACTUAL -
"This implementation determines which is the smaller of this set and the specified collection, by invoking the size method on each. If this set has fewer elements ... If the specified collection has fewer elements ..."

URL OF FAULTY DOCUMENTATION :
http://download.java.net/java/jdk9/docs/api/java/util/AbstractSet.html#removeAll-java.util.Collection-


Comments
Spec should be updated to specify the actual behavior. The phrase, ��If this set has fewer elements, ...�� should probably be something like, ��If this set has fewer or the same number of elements, ...��
15-05-2017

Moving across to dev-team for evaluation.
15-05-2017