summaryrefslogtreecommitdiff
path: root/platform/core-api/src/com/intellij/util/MergeQuery.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-09-18 20:40:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-09-18 20:40:22 +0000
commit07d35c37ce79a64bdd905b394d40fc9bbb18fa60 (patch)
treee8787c45e494dfcc558faf0f75956f8785c39b94 /platform/core-api/src/com/intellij/util/MergeQuery.java
parente222a9e1e66670a56e926a6b0f3e10231eeeb1fb (diff)
parentb5fb31ef6a38f19404859755dbd2e345215b97bf (diff)
downloadidea-07d35c37ce79a64bdd905b394d40fc9bbb18fa60.tar.gz
Merge "Merge remote-tracking branch 'aosp/upstream-master' into merge"
Diffstat (limited to 'platform/core-api/src/com/intellij/util/MergeQuery.java')
-rw-r--r--platform/core-api/src/com/intellij/util/MergeQuery.java17
1 files changed, 6 insertions, 11 deletions
diff --git a/platform/core-api/src/com/intellij/util/MergeQuery.java b/platform/core-api/src/com/intellij/util/MergeQuery.java
index 699659b93055..35d122639cd3 100644
--- a/platform/core-api/src/com/intellij/util/MergeQuery.java
+++ b/platform/core-api/src/com/intellij/util/MergeQuery.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -66,13 +66,13 @@ public class MergeQuery<T> implements Query<T>{
fq.addConsumer(SameThreadExecutor.INSTANCE, new DefaultResultConsumer<Boolean>(result) {
@Override
public void onSuccess(Boolean value) {
- if (!value.booleanValue()) {
- result.set(false);
- }
- else {
+ if (value.booleanValue()) {
final AsyncFuture<Boolean> fq2 = processSubQueryAsync(consumer, myQuery2);
fq2.addConsumer(SameThreadExecutor.INSTANCE, new DefaultResultConsumer<Boolean>(result));
}
+ else {
+ result.set(false);
+ }
}
});
return result;
@@ -85,12 +85,7 @@ public class MergeQuery<T> implements Query<T>{
}
private <V extends T> AsyncFuture<Boolean> processSubQueryAsync(@NotNull final Processor<T> consumer, @NotNull Query<V> query1) {
- return query1.forEachAsync(new Processor<V>() {
- @Override
- public boolean process(final V t) {
- return consumer.process(t);
- }
- });
+ return query1.forEachAsync((Processor<V>)consumer);
}
@NotNull