Skip to content

IllegalArgumentException: Comparison method violates general contract! #135

@clh15683

Description

@clh15683

Hello,

we get the above error when clicking on the branches folder in a tree with many branches. The class causing the error is org.tigris.subversion.subclipse.ui.repository.RepositorySorter.

This error appears in general, if the comparison operator does not guarantee that if a > b, then b < a must also be true.

As an example:
Abcde-100
ABCDE-200

The order given here is correct for case sensitive, but not for case insensitive.

In Issue #36 one path in the code was changed to use compareToIgnoreCase (line 89), other paths, like line 43 were not. Depending on the code path taken, it can happen (it does in our specific tree), that inconsistent comparison results appear.

https://github.com/subclipse/subclipse/blob/master/bundles/subclipse.ui/src/org/tigris/subversion/subclipse/ui/repository/RepositorySorter.java

The code needs to be changed to use a consistent case sensitive or insensitive comparison.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions