Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8209934

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

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Comparison method violates its general contract!
      at java.util.TimSort.mergeHi(Unknown Source)
      at java.util.TimSort.mergeAt(Unknown Source)
      at java.util.TimSort.mergeForceCollapse(Unknown Source)
      at java.util.TimSort.sort(Unknown Source)
      at java.util.Arrays.sort(Unknown Source)
      at sun.awt.datatransfer.DataTransferer.setToSortedDataFlavorArray(Unknown Source)
      at sun.awt.datatransfer.ClipboardTransferable.<init>(Unknown Source)
      at sun.awt.datatransfer.SunClipboard.getContents(Unknown Source)
      at javax.swing.TransferHandler$TransferAction.actionPerformedImpl(Unknown Source)
      at javax.swing.TransferHandler$TransferAction.access$800(Unknown Source)
      at javax.swing.TransferHandler$TransferAction$1.run(Unknown Source)
      at javax.swing.TransferHandler$TransferAction$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
      at javax.swing.TransferHandler$TransferAction$2.run(Unknown Source)
      at javax.swing.TransferHandler$TransferAction$2.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
      at javax.swing.TransferHandler$TransferAction.actionPerformed(Unknown Source)
      at javax.swing.text.JTextComponent.invokeAction(Unknown Source)
      at javax.swing.text.JTextComponent.paste(Unknown Source)
      at javax.swing.text.DefaultEditorKit$PasteAction.actionPerformed(Unknown Source)
      at javax.swing.SwingUtilities.notifyAction(Unknown Source)
      at javax.swing.JComponent.processKeyBinding(Unknown Source)
      at javax.swing.JComponent.processKeyBindings(Unknown Source)
      at javax.swing.JComponent.processKeyEvent(Unknown Source)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      By Copy&Paste Text from LibreOffice in "javax.swing.text.JTextComponent" sometimes is these Exception thrown:
      "java.lang.IllegalArgumentException: Comparison method violates its general contract!"

      Java version 1.8.0_74 is used




      CUSTOMER SUBMITTED WORKAROUND :
      -Djava.util.Arrays.useLegacyMergeSort=true

      FREQUENCY : often


            psadhukhan Prasanta Sadhukhan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: