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

OrderBy Comparable Check

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.5.2
    • None
    • None

    Description

      The OrderBy implemented method public int compare(Object o1, Object o2) was not accounting for Comparable equality. The code added is inside the if(value1 instanceof Comparable) clause. The original version of the code would return the value of compareTo regardless, whereas the change accounts for equality and calls continue in that case.

      if (value1 instanceof Comparable) {
      Comparable c1 = (Comparable) value1;
      int result = c1.compareTo(value2);
      if (result == 0)

      { continue; }

      else

      { return result; }

      }

      Attachments

        1. orderbyfix.tar
          10 kB
          Tony Lauro

        Activity

          People

            paulk Paul King
            drewwings Tony Lauro
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: