Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » "Comparison method violates its general contract!" Error
icon9.gif  "Comparison method violates its general contract!" Error [message #756308] Fri, 11 November 2011 21:24 Go to next message
lapointe683 is currently offline lapointe683Friend
Messages: 1
Registered: November 2011
Junior Member
I'm working on a Java application in Eclipse, and have been getting an error message every time I try to run it on my computer. When I run it on a different computer, it works perfectly. When the error is produced, the GUI displays correctly, but nothing else functions (e.g. KeyListener). I have worked on other projects on the same two computers, and I have never encountered the error (shown below):

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeLo(Unknown Source)
at java.util.TimSort.mergeAt(Unknown Source)
at java.util.TimSort.mergeCollapse(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(Unknown Source)
at javax.swing.SortingFocusTraversalPolicy.getFocusTraversalCycle(Unknown Source)
at javax.swing.SortingFocusTraversalPolicy.getFirstComponent(Unknown Source)
at javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(Unknown Source)
at javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(Unknown Source)
at java.awt.FocusTraversalPolicy.getInitialComponent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.SequencedEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Re: "Comparison method violates its general contract!" Error [message #756532 is a reply to message #756308] Mon, 14 November 2011 08:52 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 11.11.2011 22:24, lapointe683 wrote:
> I'm working on a Java application in Eclipse, and have been getting an
> error message every time I try to run it on my computer. When I run it
> on a different computer, it works perfectly. When the error is
> produced, the GUI displays correctly, but nothing else functions (e.g.
> KeyListener). I have worked on other projects on the same two
> computers, and I have never encountered the error (shown below):
This is caused by badly implemented comparators. While earlier JREs
tolerated this silently, it now fails in JRE 1.7. You probably use
different JREs on those two computers. The bug is in the JRE itself. For
details see:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7075600

Dani
>
> Exception in thread "AWT-EventQueue-0"
> java.lang.IllegalArgumentException: Comparison method violates its
> general contract!
> at java.util.TimSort.mergeLo(Unknown Source)
> at java.util.TimSort.mergeAt(Unknown Source)
> at java.util.TimSort.mergeCollapse(Unknown Source)
> at java.util.TimSort.sort(Unknown Source)
> at java.util.TimSort.sort(Unknown Source)
> at java.util.Arrays.sort(Unknown Source)
> at java.util.Collections.sort(Unknown Source)
> at
> javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(Unknown
> Source)
> at
> javax.swing.SortingFocusTraversalPolicy.getFocusTraversalCycle(Unknown
> Source)
> at
> javax.swing.SortingFocusTraversalPolicy.getFirstComponent(Unknown Source)
> at
> javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(Unknown Source)
> at
> javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(Unknown
> Source)
> at java.awt.FocusTraversalPolicy.getInitialComponent(Unknown Source)
> at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
> at java.awt.Component.dispatchEventImpl(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Window.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
> at java.awt.EventQueue.access$000(Unknown Source)
> at java.awt.EventQueue$3.run(Unknown Source)
> at java.awt.EventQueue$3.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
> at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
> at java.awt.EventQueue$4.run(Unknown Source)
> at java.awt.EventQueue$4.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.SequencedEvent.dispatch(Unknown Source)
> at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
> at java.awt.EventQueue.access$000(Unknown Source)
> at java.awt.EventQueue$3.run(Unknown Source)
> at java.awt.EventQueue$3.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
> at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
> at java.awt.EventQueue$4.run(Unknown Source)
> at java.awt.EventQueue$4.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
> Source)
> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
> Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.run(Unknown Source)
>
Previous Topic:superInterfaceTypes() resolve binding
Next Topic:Call Javadoc View from own editor
Goto Forum:
  


Current Time: Thu Apr 25 21:58:08 GMT 2024

Powered by FUDForum. Page generated in 0.02940 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top