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

Sort methods that accept a comparator should accept Comparator<? super T> (fix DGM signatures)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.7
    • Fix Version/s: 2.4.8
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      Methods like org.codehaus.groovy.runtime.DefaultGroovyMethods.sort(Iterable<T>, boolean, Comparator<T>) and all the others alike should be changed to accept a Comparator<? super T>, otherwise if you use @CompileStatic you'll get compiler errors as soon as you try to sort an Iterable/Collection using a comparator that accept superclass instances.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                mauromol Mauro Molinari
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: