diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog index f5cb8a52757..f8895d37c6a 100644 --- a/core/org.eclipse.cdt.ui/ChangeLog +++ b/core/org.eclipse.cdt.ui/ChangeLog @@ -1,3 +1,6 @@ +2004-07-08 Hoda Amer + Partial fix for PR 69439: content assist confusion + 2004-07-08 Bogdan Gheorghe Fix for 64177: [Search] Clean up Selection Search UI Fix for 57121: [Search] Searching when all of the "Search For" checkboxes are unchecked causes an exception diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposal.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposal.java index 3b23654881a..937c97621a2 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposal.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProposal.java @@ -649,5 +649,29 @@ public class CCompletionProposal implements ICCompletionProposal, ICompletionPro public void updateReplacementLength(int length) { setReplacementLength(length); } + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + public int hashCode() { + return fDisplayString.hashCode() + + fReplacementString.hashCode() + + ((fContextInformation == null) ? 0 : fContextInformation.hashCode()); + } + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + public boolean equals(Object other) { + if(!(other instanceof CCompletionProposal)) + return false; + if(!(fDisplayString.equals(((CCompletionProposal)other).fDisplayString))) + return false; + if(!(fReplacementString.equals(((CCompletionProposal)other).fReplacementString))) + return false; + if((fContextInformation != null) && (((CCompletionProposal)other).fContextInformation != null) && (!(fContextInformation.equals(((CCompletionProposal)other).fContextInformation)))) + return false; + + return true; + } + } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionEngine.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionEngine.java index 5baf2cd5e74..b7971ae66e7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionEngine.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CompletionEngine.java @@ -774,6 +774,11 @@ public class CompletionEngine implements RelevanceConstants { return null; } + if(completionNode.getCompletionKind() == CompletionKind.NO_SUCH_KIND){ + log("Invalid Completion Kind Error"); //$NON-NLS-1$ + return null; + } + // set the completionStart and the completionLength completionOrigin = completionOffset; completionStart = completionOffset - completionNode.getCompletionPrefix().length();