Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 468234 - Comparison method violates its general contract
Summary: Comparison method violates its general contract
Status: CLOSED DUPLICATE of bug 371586
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-25 17:19 EDT by George Lindholm CLA
Modified: 2022-12-31 09:49 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Lindholm CLA 2015-05-25 17:19:32 EDT
What steps will reproduce the problem?
1. Rebuilding large workspace
2. 
3. 


-- Error Details --
Date: Mon May 25 14:14:01 PDT 2015
Message: An internal error occurred during: "Searching for markers".
Severity: Error
Product: Eclipse SDK 4.5.0.v20150522-2000 (org.eclipse.sdk.ide)
Plugin: org.eclipse.core.jobs
Session Data:
eclipse.buildId=4.5.0.I20150522-2000
java.version=1.8.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_CA
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -clean -data file:/W:/workspace/

This is a continuation of log file W:\workspace\.metadata\.bak_1.log
Created Time: 2015-05-25 14:08:28.748

Exception Stack Trace:
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.mergeCollapse(Unknown Source)
	at java.util.TimSort.sort(Unknown Source)
	at java.util.Arrays.sort(Unknown Source)
	at org.eclipse.ui.internal.views.markers.MarkerSortUtil.sortStartingKElement(MarkerSortUtil.java:326)
	at org.eclipse.ui.internal.views.markers.Markers.sortMarkerEntries(Markers.java:159)
	at org.eclipse.ui.internal.views.markers.Markers.sortAndMakeCategories(Markers.java:132)
	at org.eclipse.ui.internal.views.markers.Markers.updateWithNewMarkers(Markers.java:96)
	at org.eclipse.ui.internal.views.markers.MarkerUpdateJob.processMarkerEntries(MarkerUpdateJob.java:125)
	at org.eclipse.ui.internal.views.markers.MarkerUpdateJob.buildMarkers(MarkerUpdateJob.java:79)
	at org.eclipse.ui.internal.views.markers.MarkerUpdateJob.run(MarkerUpdateJob.java:51)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Daniel CLA 2016-11-22 06:25:30 EST
Hi there,

i also currently am experiencing this exception and found some other bugs that are talking about this. Most fitting probably would be Bug 371586.

A (blunt?) workaround mentioned there (in Bug 371586 Comment 2 - https://bugs.eclipse.org/bugs/show_bug.cgi?id=371586#c2) would be to add 

-Djava.util.Arrays.useLegacyMergeSort=true to 

your eclipse.ini.

Maybe someone who reads this can add the abovementioned Bug to the seealso field(s)?

HTH Daniel

P.S.: https://dertompson.com/2012/11/23/sort-algorithm-changes-in-java-7/ is also talking about the underlying phenomenon.
Comment 2 Andrey Loskutov CLA 2017-10-19 05:33:09 EDT

*** This bug has been marked as a duplicate of bug 512334 ***
Comment 3 Andrey Loskutov CLA 2017-10-19 05:35:25 EDT

*** This bug has been marked as a duplicate of bug 371586 ***
Comment 4 Hontvári Levente CLA 2022-12-31 09:49:07 EST
The workaround works for me in Eclipse 2022-12