Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug in RepositorySorter #265

Merged
merged 1 commit into from
May 1, 2023
Merged

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
3 checks passed
@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.

None yet

2 participants