Index: ui/org/eclipse/jdt/internal/ui/text/java/OverrideCompletionProposal.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/OverrideCompletionProposal.java,v --- ui/org/eclipse/jdt/internal/ui/text/java/OverrideCompletionProposal.java 31 Aug 2006 08:52:19 -0000 1.29 +++ ui/org/eclipse/jdt/internal/ui/text/java/OverrideCompletionProposal.java 24 May 2007 06:42:59 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -182,4 +182,13 @@ public boolean isAutoInsertable() { return false; } + + /* + * @see org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal#getPrefixValidationString() + * @since 3.3 + */ + protected String getPrefixValidationString() { + return getDisplayString(); + } + } Index: ui/org/eclipse/jdt/internal/ui/text/java/AbstractJavaCompletionProposal.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AbstractJavaCompletionProposal.java,v --- ui/org/eclipse/jdt/internal/ui/text/java/AbstractJavaCompletionProposal.java 17 Mar 2007 07:17:19 -0000 1.23 +++ ui/org/eclipse/jdt/internal/ui/text/java/AbstractJavaCompletionProposal.java 24 May 2007 06:42:59 -0000 @@ -694,7 +694,7 @@ * proposal is still valid. *
* The default implementation checks if prefix
is a prefix of the proposal's
- * {@link #getDisplayString() display string} using the {@link #isPrefix(String, String) }
+ * {@link #getReplacementString() display string} using the {@link #isPrefix(String, String) }
* method.
*
true
if prefix
is a valid prefix of this proposal
*/
protected boolean isValidPrefix(String prefix) {
- /*
- * See http://dev.eclipse.org/bugs/show_bug.cgi?id=17667
- * why we do not use the replacement string.
- * String word= fReplacementString;
- */
- return isPrefix(prefix, getDisplayString());
+ return isPrefix(prefix, getPrefixValidationString());
+ }
+
+ /**
+ * Returns the string used to do the prefix validation.
+ *
+ * @return the string for the prefix validation.
+ * @since 3.3
+ */
+ protected String getPrefixValidationString() {
+ return getReplacementString();
}
/**
Index: ui/org/eclipse/jdt/internal/ui/text/java/MethodDeclarationCompletionProposal.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/MethodDeclarationCompletionProposal.java,v
--- ui/org/eclipse/jdt/internal/ui/text/java/MethodDeclarationCompletionProposal.java 8 Jan 2007 13:09:54 -0000 1.1
+++ ui/org/eclipse/jdt/internal/ui/text/java/MethodDeclarationCompletionProposal.java 24 May 2007 06:42:59 -0000
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -192,4 +192,13 @@
public boolean isAutoInsertable() {
return false;
}
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal#getPrefixValidationString()
+ * @since 3.3
+ */
+ protected String getPrefixValidationString() {
+ return getDisplayString();
+ }
+
}
Index: ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProposal.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProposal.java,v
--- ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProposal.java 18 Jan 2007 18:12:19 -0000 1.93
+++ ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProposal.java 24 May 2007 06:42:59 -0000
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,8 +31,8 @@
* @param replacementOffset the offset of the text to be replaced
* @param replacementLength the length of the text to be replaced
* @param image the image to display for this proposal
- * @param displayString the string to be displayed for the proposal If set to null
,
- * the replacement string will be taken as display string.
+ * @param displayString the string to be displayed for the proposal If set to null
, the replacement string will be taken as display string.
+ * @param relevance the relevance
*/
public JavaCompletionProposal(String replacementString, int replacementOffset, int replacementLength, Image image, String displayString, int relevance) {
this(replacementString, replacementOffset, replacementLength, image, displayString, relevance, false);
@@ -92,7 +92,7 @@
* @see org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal#isValidPrefix(java.lang.String)
*/
protected boolean isValidPrefix(String prefix) {
- String word= getDisplayString();
+ String word= getPrefixValidationString();
if (isInJavadoc()) {
int idx = word.indexOf("{@link "); //$NON-NLS-1$
if (idx==0) {