Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2017-02-07 19:26:29 +0000
committerAndrey Loskutov2017-02-07 19:26:29 +0000
commit9215067faef8e81e781e754094a35d16ac08e09f (patch)
tree6dc3287a2c6434f13a40d60d004eb039a0946d76
parent62df94df0cfd7a40b297107fa5b9ef0f781f4f68 (diff)
downloadeclipse.platform.text-9215067faef8e81e781e754094a35d16ac08e09f.tar.gz
eclipse.platform.text-9215067faef8e81e781e754094a35d16ac08e09f.tar.xz
eclipse.platform.text-9215067faef8e81e781e754094a35d16ac08e09f.zip
Bug 511863 - [regression] NPE inI20170207-2000
CompletionProposalPopup.computeProposals Change-Id: I6fafe29a1ed3289f8d6a9e909d2cd2e3136305f2 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
index b119ae22d..7bc89a9cf 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
@@ -550,17 +550,19 @@ class CompletionProposalPopup implements IContentAssistListener {
* requested with {@link #fSorter}.
*
* @param offset the offset
- * @return the completion proposals available at this offset
+ * @return the completion proposals available at this offset, never null
*/
private List<ICompletionProposal> computeProposals(int offset) {
- List<ICompletionProposal> proposals;
+ ICompletionProposal[] completionProposals;
if (fContentAssistSubjectControl != null) {
- proposals= Arrays.asList(fContentAssistant.computeCompletionProposals(fContentAssistSubjectControl, offset));
+ completionProposals= fContentAssistant.computeCompletionProposals(fContentAssistSubjectControl, offset);
} else {
- proposals= Arrays.asList(fContentAssistant.computeCompletionProposals(fViewer, offset));
+ completionProposals= fContentAssistant.computeCompletionProposals(fViewer, offset);
}
- if (proposals == null)
+ if (completionProposals == null) {
return Collections.emptyList();
+ }
+ List<ICompletionProposal> proposals= Arrays.asList(completionProposals);
if (fSorter != null) {
sortProposals(proposals);
fIsInitialSort= true;

Back to the top