Skip to content

Conversation

@cantorio
Copy link
Contributor

In "SVN Repositories" view if branch name contains more than 6 digits in a row, in some circumstances exception occurres when trying to open a tree:

java.lang.IllegalArgumentException: Comparison method violates its general contract!
Workaround for comparator violation:
Set system property -Djava.util.Arrays.useLegacyMergeSort=true
this: org.tigris.subversion.subclipse.ui.repository.RepositorySorter
comparator: java.text.RuleBasedCollator

Detailed stacktrace is:
java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.base/java.util.TimSort.mergeHi(TimSort.java:903)
at java.base/java.util.TimSort.mergeAt(TimSort.java:520)
at java.base/java.util.TimSort.mergeCollapse(TimSort.java:448)
at java.base/java.util.TimSort.sort(TimSort.java:245)
at java.base/java.util.Arrays.sort(Arrays.java:1233)
at org.eclipse.jface.viewers.ViewerComparator.sort(ViewerComparator.java:206)

I provided a solution and also added system property to be able to disable complex "revision" comparison of branch names in eclipse.ini.
It would be great if someone check this fix and merge into master branch.

@markphip
Copy link
Contributor

I provided a solution and also added system property to be able to disable complex "revision" comparison of branch names in eclipse.ini.

Given that you provided a solution, what was the reason behind the second part of this change?

@markphip markphip merged commit af879c1 into subclipse:master May 1, 2023
@cantorio
Copy link
Contributor Author

cantorio commented May 1, 2023

Given that you provided a solution, what was the reason behind the second part of this change?

Sorry for the late response. Actually, the first thing i did when i faced a given issue and didn't want to check all comparison logic, was disabling it with a flag and "patching" a jar inside my eclipse installation. Only after I had some free time to actually dive into that logic, I provided a fail-safe solution, but didn't remove a flag, as logic still remains a bit tricky in my opinion.
P.S. Thanks for merging into master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants