From 12fa9480e9574f6632a9a8efada4f3377616dd72 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 29 Jul 2010 13:59:01 +0100 Subject: [PATCH] fix many methods reported as unused: in the optimized search world the first of the two merged queries may be satisfied only when the second one is running. Unfortunately --- platform/util/src/com/intellij/util/MergeQuery.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/platform/util/src/com/intellij/util/MergeQuery.java b/platform/util/src/com/intellij/util/MergeQuery.java index ffeeed377d57..1f221aa3e10d 100644 --- a/platform/util/src/com/intellij/util/MergeQuery.java +++ b/platform/util/src/com/intellij/util/MergeQuery.java @@ -38,15 +38,14 @@ public class MergeQuery implements Query{ @NotNull public Collection findAll() { List results = new ArrayList(); - results.addAll(myQuery1.findAll()); - results.addAll(myQuery2.findAll()); + forEach(new CommonProcessors.CollectProcessor(results)); return results; } public T findFirst() { - final T r1 = myQuery1.findFirst(); - if (r1 != null) return r1; - return myQuery2.findFirst(); + final CommonProcessors.FindFirstProcessor processor = new CommonProcessors.FindFirstProcessor(); + forEach(processor); + return processor.getFoundValue(); } public boolean forEach(@NotNull final Processor consumer) {