Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8180348

AbstractSet.removeAll does not specify the case when collections are the same size

XMLWordPrintable

      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-

            smarks Stuart Marks
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: