Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2018-09-14 06:47:24 -0400
committerMickael Istria2018-09-14 07:17:54 -0400
commit29bf56750751161c20aa3ab9d2b02c357bb30dee (patch)
tree040ae68627dd8e3da423de7172c63b3040fe9a9f
parent591ba6ddca9d65cd6b0631aebd92831c8cabc251 (diff)
downloadeclipse.platform.text-29bf56750751161c20aa3ab9d2b02c357bb30dee.tar.gz
eclipse.platform.text-29bf56750751161c20aa3ab9d2b02c357bb30dee.tar.xz
eclipse.platform.text-29bf56750751161c20aa3ab9d2b02c357bb30dee.zip
Bug 538876 - Fix type-check warning
Change-Id: Ie89b7f07a7c16f1cadd53582f288625ebd2ce745 Signed-off-by: Mickael Istria <mistria@redhat.com>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java
index 9bcb4ef06..f23b232db 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java
@@ -15,8 +15,10 @@ package org.eclipse.jface.text.contentassist;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
@@ -344,18 +346,18 @@ class AsyncCompletionProposalPopup extends CompletionProposalPopup {
List<CompletableFuture<List<ICompletionProposal>>> futures = new ArrayList<>(processors.size());
for (IContentAssistProcessor processor : processors) {
futures.add(CompletableFuture.supplyAsync(() -> {
- final List<ICompletionProposal>[] result= new List[] { null };
+ final Collection<List<ICompletionProposal>> result= new LinkedList<>();
SafeRunner.run(new ISafeRunnable() {
@Override
public void run() throws Exception {
ICompletionProposal[] proposals= processor.computeCompletionProposals(fViewer, invocationOffset);
if (proposals == null) {
- result[0]= Collections.emptyList();
+ result.add(Collections.emptyList());
}
- result[0]= Arrays.asList(proposals);
+ result.add(Arrays.asList(proposals));
}
});
- return result[0];
+ return result.iterator().next();
}));
}
return futures;

Back to the top