-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
8.13.9
-
None
-
8.13
-
6
-
Severity 3 - Minor
-
0
-
Issue Summary
TimSort throws "Comparison method violates its general contract!" error.
This is similar to the reported Confluence bug# CONFSERVER-58059
In my specific case, it was being thrown when trying to create a new Application link in Jira.
Steps to Reproduce
When trying to create an application link Cog -> Applications -> Application Links. From here trying to create an application link IE https://example-test.com This pops open the configure application URL to confirm the URL. The configuration just needs the Application Name and the checkbox for Create Incoming Link checked. This results in the "Comparison method violates its general contract!" error in the UI.
Expected Results
No exception raised and continues with the requested operation.
Actual Results
The below exception is thrown in the atlassian-jira.log file:
Uncaught exception thrown by REST service: Comparison method violates its general contract! java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.util.TimSort.mergeLo(TimSort.java:777) at java.util.TimSort.mergeAt(TimSort.java:514) at java.util.TimSort.mergeCollapse(TimSort.java:441) at java.util.TimSort.sort(TimSort.java:245) at java.util.Arrays.sort(Arrays.java:1512) at java.util.ArrayList.sort(ArrayList.java:1464)
Workaround
Adding this JVM system property fixes the issue:
-Djava.util.Arrays.useLegacyMergeSort=true
- relates to
-
CONFSERVER-58059 NaturalStringComparator causes "Comparison method violates its general contract!" when specific order of strings given
- Long Term Backlog