mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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
This commit is contained in:
@@ -38,15 +38,14 @@ public class MergeQuery<T> implements Query<T>{
|
||||
@NotNull
|
||||
public Collection<T> findAll() {
|
||||
List<T> results = new ArrayList<T>();
|
||||
results.addAll(myQuery1.findAll());
|
||||
results.addAll(myQuery2.findAll());
|
||||
forEach(new CommonProcessors.CollectProcessor<T>(results));
|
||||
return results;
|
||||
}
|
||||
|
||||
public T findFirst() {
|
||||
final T r1 = myQuery1.findFirst();
|
||||
if (r1 != null) return r1;
|
||||
return myQuery2.findFirst();
|
||||
final CommonProcessors.FindFirstProcessor<T> processor = new CommonProcessors.FindFirstProcessor<T>();
|
||||
forEach(processor);
|
||||
return processor.getFoundValue();
|
||||
}
|
||||
|
||||
public boolean forEach(@NotNull final Processor<T> consumer) {
|
||||
|
||||
Reference in New Issue
Block a user