Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 531332

Summary: Comparison method violates its general contract while filtering
Product: [Eclipse Project] Platform Reporter: Noopur Gupta <noopur_gupta>
Component: UIAssignee: Lucas Bullen <lbullen>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: akurtakov, daniel_megert
Version: 4.8   
Target Milestone: 4.8 M6   
Hardware: PC   
OS: Windows 7   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=109670
https://git.eclipse.org/r/117956
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=9cb6a77fc17521ac18996c43fc2e73651a2793a7
https://bugs.eclipse.org/bugs/show_bug.cgi?id=534277
Whiteboard:
Bug Depends on: 525974    
Bug Blocks: 537394    

Description Noopur Gupta CLA 2018-02-19 04:24:46 EST
I20180218-2000

In my existing workspace, I opened the Open Type dialog and typed "New" in the filter. I got the following exception. It happened thrice but after that, I couldn't reproduce it.

org.eclipse.core.jobs
Error
Mon Feb 19 14:39:05 IST 2018
An internal error occurred during: "Items filtering".

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 java.util.ArrayList.sort(Unknown Source)
	at java.util.Collections$SynchronizedList.sort(Unknown Source)
	at java.util.Collections.sort(Unknown Source)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ContentProvider.getSortedItems(FilteredItemsSelectionDialog.java:2702)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ContentProvider.rememberResult(FilteredItemsSelectionDialog.java:2715)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.filterContent(FilteredItemsSelectionDialog.java:2055)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.internalRun(FilteredItemsSelectionDialog.java:1999)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.doRun(FilteredItemsSelectionDialog.java:1971)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.run(FilteredItemsSelectionDialog.java:1958)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Comment 1 Noopur Gupta CLA 2018-02-19 04:27:00 EST
See bug 109670 also which was getting the same issue while trying to fix the sort order in Open Type dialog.
Comment 2 Noopur Gupta CLA 2018-02-20 07:18:02 EST
Lucas, please have a look.
Comment 3 Eclipse Genie CLA 2018-02-22 10:37:36 EST
New Gerrit change created: https://git.eclipse.org/r/117956
Comment 5 Dani Megert CLA 2018-07-26 08:53:44 EDT
(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/117956 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=9cb6a77fc17521ac18996c43fc2e73651a2793a7
> 

Looks like this did not fix the problem. See bug 537394.