Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4742

Documentation for Collection.sort(Comparator comparator) is wrong

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.8.1
    • groovy-jdk
    • None

    Description

      The documentation for Collection.sort(Comparator comparator) at http://groovy.codehaus.org/groovy-jdk/java/util/Collection.html#sort%28java.util.Comparator%29 states

      Sorts the Collection using the given comparator. The elements are sorted into a new list, and the existing collection is unchanged.

      However, it does seem to mutate the original list

      Attachments

        1. groovy4742_sortImprovements.patch
          10 kB
          Paul King
        2. groovy4742_uniqueImprovements.patch
          11 kB
          Tim Yates
        3. groovy4742_mutationImprovements.patch
          28 kB
          Paul King

        Activity

          People

            paulk Paul King
            tim_yates Tim Yates
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: