Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Bullen2018-02-22 15:36:32 +0000
committerAlexander Kurtakov2018-02-27 21:39:35 +0000
commit9cb6a77fc17521ac18996c43fc2e73651a2793a7 (patch)
tree7e18884c421d78c86c50a9ecd9a8aeae527ffb37
parent28b07a52698cefa82501c4e0efb20d2057ba55d8 (diff)
downloadeclipse.platform.ui-9cb6a77fc17521ac18996c43fc2e73651a2793a7.tar.gz
eclipse.platform.ui-9cb6a77fc17521ac18996c43fc2e73651a2793a7.tar.xz
eclipse.platform.ui-9cb6a77fc17521ac18996c43fc2e73651a2793a7.zip
Bug 531332 - Comparison method violates its general contractI20180227-2000
- Recreated error with sleep in compare and rapidly changing the filter - Causing different filters to be used, making the comparison non-transitive. - Now using a stored filter for the compare that is reset during the cache reload Change-Id: I0a26fbc30c9703225f1763a480e0c6e4a5b7d140 Signed-off-by: Lucas Bullen <lbullen@redhat.com>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
index 1614a7dc40f..f8a69fb2feb 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredItemsSelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,7 +14,7 @@
* Simon Muschel <smuschel@gmx.de> - bug 258493
* Lars Vogel <Lars.Vogel@gmail.com> - Bug 440810
* Patrik Suzzi <psuzzi@gmail.com> - Bug 485133
- * Lucas Bullen <lbullen@redhat.com> - Bug 525974
+ * Lucas Bullen <lbullen@redhat.com> - Bug 525974, 531332
*******************************************************************************/
package org.eclipse.ui.dialogs;
@@ -205,6 +205,8 @@ public abstract class FilteredItemsSelectionDialog extends SelectionStatusDialog
private ItemsFilter filter;
+ private ItemsFilter currentlyCompletingFilter;
+
private List lastCompletedResult;
private ItemsFilter lastCompletedFilter;
@@ -2762,6 +2764,7 @@ public abstract class FilteredItemsSelectionDialog extends SelectionStatusDialog
*/
public void reloadCache(boolean checkDuplicates, IProgressMonitor monitor) {
reset = false;
+ currentlyCompletingFilter = filter;
// the work is divided into two actions of the same length
int totalWork = checkDuplicates ? 200 : 100;
@@ -3069,8 +3072,8 @@ public abstract class FilteredItemsSelectionDialog extends SelectionStatusDialog
@Override
public int compare(Object o1, Object o2) {
// find perfect matches
- if (filter != null) {
- String filterPattern = filter.getPattern();
+ if (currentlyCompletingFilter != null) {
+ String filterPattern = currentlyCompletingFilter.getPattern();
// See if any are exact matches
boolean m1 = filterPattern.equals(getElementName(o1));
boolean m2 = filterPattern.equals(getElementName(o2));

Back to the top