Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteicher2005-04-26 14:59:53 +0000
committerteicher2005-04-26 14:59:53 +0000
commitfcdbc549317be0dd59613f462c9ecb5a1f63d503 (patch)
treeaf4bad452f26e5c720210b4b1f528ae7ae7a3fbb /org.eclipse.jface.text/src
parentc140e2e6427d87e8a9c7cc730a3a6bf00215dd6b (diff)
downloadeclipse.platform.text-fcdbc549317be0dd59613f462c9ecb5a1f63d503.tar.gz
eclipse.platform.text-fcdbc549317be0dd59613f462c9ecb5a1f63d503.tar.xz
eclipse.platform.text-fcdbc549317be0dd59613f462c9ecb5a1f63d503.zip
fix NPEs
Diffstat (limited to 'org.eclipse.jface.text/src')
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java25
1 files changed, 15 insertions, 10 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 eaf5114f7f6..d15d28cf5b9 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
@@ -1039,11 +1039,14 @@ class CompletionProposalPopup implements IContentAssistListener {
insertProposal(fFilteredProposals[0], (char) 0, 0, fInvocationOffset);
hide();
} else {
- completeCommonPrefix();
- fComputedProposals= fFilteredProposals;
- createProposalSelector();
- setProposals(fComputedProposals, false);
- displayProposals();
+ if (completeCommonPrefix())
+ hide();
+ else {
+ fComputedProposals= fFilteredProposals;
+ createProposalSelector();
+ setProposals(fComputedProposals, false);
+ displayProposals();
+ }
}
}
});
@@ -1054,10 +1057,12 @@ class CompletionProposalPopup implements IContentAssistListener {
/**
* Acts upon <code>fFilteredProposals</code>: if there is just one valid
* proposal, it is inserted, otherwise, the common prefix of all proposals
- * is inserted into the document. If there is no common prefix, <code>false</code>
- * is returned.
- *
- * @return <code>true</code> if common prefix insertion was successful, <code>false</code> otherwise
+ * is inserted into the document. If there is no common prefix, nothing
+ * happens and <code>false</code> is returned.
+ *
+ * @return <code>true</code> if a single proposal was inserted and the
+ * selector can be closed, <code>false</code> if more than once
+ * choice remain
* @since 3.0
*/
private boolean completeCommonPrefix() {
@@ -1169,7 +1174,7 @@ class CompletionProposalPopup implements IContentAssistListener {
fContentAssistSubjectControlAdapter.setSelectedRange(fFilterOffset + postfix.length(), 0);
fContentAssistSubjectControlAdapter.revealRange(fFilterOffset + postfix.length(), 0);
- return postfix.length() > 0;
+ return false;
} catch (BadLocationException e) {
// ignore and return false
return false;

Back to the top