PlayPlugin has wrong implementation of compareTo
Bug #636861 reported by
niels
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
play framework |
New
|
Undecided
|
Unassigned |
Bug Description
The compareTo method of PlayPlugin ignore the rule that if a.compareTo(b) == 0 should follows a.equals(b). So I would recommend to replace it with the following
/**
* {@inheritDoc}
*/
public int compareTo(
final int result = (index < o.index ? -1 : (index == o.index ? 0 : 1));
if (result == 0) {
return this.getClass(
} else {
return result;
}
}
I forget this in some projects and it cost me lot of time to find the bug, if someone rely on this, which happens at least in groovy maps.
To post a comment you must log in.