Sun Defect 7075600 - "Comparison method violates its general contract!" errors - and Problems with the Work-around

(Doc ID 1507950.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Java Platform, Standard Edition - Version 7 to 7 [Release 7]
Information in this document applies to any platform.
Applications started through Java Web Start included in Java SE 7 up to Java SE 7 Update 5.
It affects both 32 and 64 bit versions of Java.


The Java exception "java.lang.IllegalArgumentException: Comparison method violates its general contract!" can happen on applications started through Java Web Start and Java SE 7 to Java SE 7 Update 5, even with the work-around in place.  If you are hitting this issue while running applications without Java Web Start, you might be missing the work-around for Sun Bug 7075600.  See the Solution Section of this document.

The top of the stack trace related to this issue looks like:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(
at java.util.TimSort.mergeAt(
at java.util.TimSort.mergeForceCollapse(
at java.util.TimSort.sort(
at java.util.TimSort.sort(
at java.util.Arrays.sort(
at java.util.Collections.sort(
at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(
at javax.swing.SortingFocusTraversalPolicy.getFocusTraversalCycle(
at javax.swing.SortingFocusTraversalPolicy.getFirstComponent(
at javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(
at javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(
at javax.swing.JComponent.requestDefaultFocus(
at sun.swing.SwingUtilities2.tabbedPaneChangeFocusTo(
at javax.swing.JTabbedPane.fireStateChanged(
at javax.swing.JTabbedPane$ModelListener.stateChanged(
at javax.swing.DefaultSingleSelectionModel.fireStateChanged(
at javax.swing.DefaultSingleSelectionModel.setSelectedIndex(
at javax.swing.JTabbedPane.setSelectedIndexImpl(
at javax.swing.JTabbedPane.setSelectedIndex(
at javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mousePressed(
at java.awt.Component.processMouseEvent(



 Implementation of the enhancement request created through Sun Bug 6804124 in Java SE 7 or later.


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms