Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikaël Barbero2013-10-13 14:15:15 -0400
committerMikaël Barbero2013-10-18 13:47:52 -0400
commitfdfd1a68ca828887245e720a953ad8664c2d387b (patch)
tree2e2a3badfef363f1deae2804d115c0cd9d81b0fb /plugins/org.eclipse.emf.compare.ide.ui/src
parent2e4fb94d762a6f86dbdcbb1fe147669a3534db74 (diff)
downloadorg.eclipse.emf.compare-fdfd1a68ca828887245e720a953ad8664c2d387b.tar.gz
org.eclipse.emf.compare-fdfd1a68ca828887245e720a953ad8664c2d387b.tar.xz
org.eclipse.emf.compare-fdfd1a68ca828887245e720a953ad8664c2d387b.zip
Do not add all diff to acc without testing it is filtered from viewer
Diffstat (limited to 'plugins/org.eclipse.emf.compare.ide.ui/src')
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/util/JFaceUtil.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/util/JFaceUtil.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/util/JFaceUtil.java
index a2ef7c31e..af1168cc2 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/util/JFaceUtil.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/util/JFaceUtil.java
@@ -10,13 +10,10 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal.util;
-import static com.google.common.collect.Iterables.addAll;
import static com.google.common.collect.Sets.newHashSet;
import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import java.util.Arrays;
import java.util.Set;
import org.eclipse.jface.viewers.ITreeContentProvider;
@@ -60,7 +57,7 @@ public class JFaceUtil {
Set<Object> acc = newHashSet();
ITreeContentProvider contentProvider = (ITreeContentProvider)treeViewer.getContentProvider();
Object[] elements = contentProvider.getElements(treeViewer.getInput());
- getMatchCount(treeViewer, elements, null, predicate, acc);
+ appendNonFilteredChildren(treeViewer, elements, null, predicate, acc);
return acc;
}
@@ -70,16 +67,15 @@ public class JFaceUtil {
* @param diffs
* @return
*/
- private static void getMatchCount(TreeViewer treeViewer, Object[] elements, Object parent,
+ private static void appendNonFilteredChildren(TreeViewer treeViewer, Object[] elements, Object parent,
Predicate<? super Object> predicate, Set<Object> acc) {
final ITreeContentProvider cp = (ITreeContentProvider)treeViewer.getContentProvider();
- addAll(acc, Iterables.filter(Arrays.asList(elements), predicate));
for (Object element : elements) {
if (!isFiltered(treeViewer, element, parent) && predicate.apply(element)) {
acc.add(element);
}
Object[] children = cp.getChildren(element);
- getMatchCount(treeViewer, children, element, predicate, acc);
+ appendNonFilteredChildren(treeViewer, children, element, predicate, acc);
}
}
}

Back to the top