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

Javadoc for ConcurrentSkipListSet.add(E e) is wrong

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      The Javadoc for ConcurrentSkipListSet's add(E e) method states that the method "adds the specified element e to this set if the set contains no element e2 such that e.equals(e2)". This is not true, since it actually determines equality using natural ordering (i.e. a Comparable's compareTo method), unless a custom comparator is defined. This can lead to elements not being added because they were unexpectedly determined to be equal to another element.


            nbenalla Nizar Benalla
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: