Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0
-
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)
else
{ return result; }}