History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GROOVY-1855
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Paul King
Reporter: Tony Lauro
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

OrderBy Comparable Check

Created: 25/Apr/07 03:36 PM   Updated: 08/Feb/08 01:26 AM
Component/s: None
Affects Version/s: 1.0
Fix Version/s: 1.5.2

Time Tracking:
Not Specified

File Attachments: 1. File orderbyfix.tar (10 kb)


Testcase included: yes


 Description  « Hide
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; }
}



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Tony Lauro - 25/Apr/07 03:37 PM
I am only submitting code for Rod Cope.

Paul King - 23/Dec/07 08:49 PM
Patch applied, Thanks. Please pass thanks on to Rod too.

Paul King - 08/Feb/08 01:26 AM
close off release 1.5.4