Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-72911

TimSort throws "Comparison method violates its general contract!" error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 8.13.9
    • Application Links
    • None

      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

       

              Unassigned Unassigned
              mshahlori Mahtab
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: