PlayPlugin has wrong implementation of compareTo

Bug #636861 reported by niels
6
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(PlayPlugin o) {
        final int result = (index < o.index ? -1 : (index == o.index ? 0 : 1));
        if (result == 0) {
            return this.getClass().getName().compareTo(o.getClass().getName());
        } 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.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.