Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-307

SetUniqueList.subList().contains() method checks against full parent list, not sublist range

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2
    • 3.2.2, 4.0-alpha1, 4.0
    • List
    • None

    Description

      The view returned by the subList() method of a SetUniqueList checks contains() against the set of the original list.

      As shown by the following test snippet.

      List list = new ArrayList();
      List uniqueList = SetUniqueList.decorate(list);
      uniqueList.add("Hello");
      uniqueList.add("World");
      List subList = list.subList(0, 0);
      List subUniqueList = uniqueList.subList(0, 0);
      assertFalse(subList.contains("World")); // passes
      assertFalse(subUniqueList.contains("World")); // fails

      Attachments

        1. COLLECTIONS-307.patch
          3 kB
          Henri Yandell

        Activity

          People

            Unassigned Unassigned
            chsemrau Christian Semrau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: