Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 67098 Details for
Bug 185576
[javadoc][assist] Type parameters should not be proposed while completing in @link or @see reference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
[patch]: proposed fix + test cases
b185576_on_top_v758_02.txt (text/plain), 4.95 KB, created by
Eric Jodet
on 2007-05-14 12:49:09 EDT
(
hide
)
Description:
[patch]: proposed fix + test cases
Filename:
MIME Type:
Creator:
Eric Jodet
Created:
2007-05-14 12:49:09 EDT
Size:
4.95 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.327 >diff -u -r1.327 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 26 Apr 2007 11:27:48 -0000 1.327 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 14 May 2007 16:46:05 -0000 >@@ -6499,7 +6499,7 @@ > > if (!skip && proposeType && scope.enclosingSourceType() != null) { > findNestedTypes(token, scope.enclosingSourceType(), scope, proposeAllMemberTypes, typesFound); >- if(!assistNodeIsConstructor && !assistNodeIsAnnotation) { >+ if((!assistNodeIsConstructor && !assistNodeIsAnnotation) && this.assistNodeInJavadoc == 0) { > // don't propose type parameters if the completion is a constructor ('new |') > findTypeParameters(token, scope); > } >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java,v >retrieving revision 1.21 >diff -u -r1.21 JavadocBugsCompletionModelTest.java >--- src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java 2 Mar 2007 14:38:41 -0000 1.21 >+++ src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java 14 May 2007 16:46:35 -0000 >@@ -1058,4 +1058,57 @@ > completeInJavadoc("/Completion/src/bugs/b171031/BasicTestBugs.java", source, true, "@In", 1); > assertSortedResults(""); // should not have any proposal as > } >+ >+/** >+ * @bug 185576: [javadoc][assist] Type parameters should not be proposed while completing in @link or @see reference >+ * @test Do not include type params in Javadoc content assist proposals >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=185576" >+ */ >+public void testONLY_Bug185576a() throws JavaModelException { >+ setUpProjectOptions(CompilerOptions.VERSION_1_5); >+ String source = >+ "package bugs.b185576;\n" + >+ "public class BasicTestBugs {\n" + >+ " /**\n" + >+ " * The return type is {@link } and that is all. \n" + >+ " * \n" + >+ " * @param <X>\n" + >+ " * @param t\n" + >+ " * @return something.\n" + >+ " */\n" + >+ " public <X> X foooo(X t) {\n" + >+ " return null;\n" + >+ " }\n" + >+ "}\n"; >+ completeInJavadoc("/Completion/src/bugs/b185576/BasicTestBugs.java", source, true, "@link ", 0); >+ String emptyPositions = "["+this.completionStart+", "+this.completionStart+"], "; >+ assertSortedResults( >+ "BasicTestBugs[TYPE_REF]{BasicTestBugs, bugs.b185576, Lbugs.b185576.BasicTestBugs;, null, null, "+emptyPositions+R_DRICUNR+"}" >+ ); >+} >+ >+public void testONLY_Bug185576b() throws JavaModelException { >+ setUpProjectOptions(CompilerOptions.VERSION_1_5); >+ String source = >+ "package bugs.b185576;\n" + >+ "public class BasicTestBugs {\n" + >+ " /**\n" + >+ " * The return type is {@link } and that is all. \n" + >+ " * \n" + >+ " * @param <X>\n" + >+ " * @param t\n" + >+ " * @return something.\n" + >+ " */\n" + >+ " public <X> X foooo(X t) {\n" + >+ " return null;\n" + >+ " }\n" + >+ " class X {}\n" + >+ "}\n"; >+ completeInJavadoc("/Completion/src/bugs/b185576/BasicTestBugs.java", source, true, "@link ", 0); >+ String emptyPositions = "["+this.completionStart+", "+this.completionStart+"], "; >+ assertSortedResults( >+ "BasicTestBugs[TYPE_REF]{BasicTestBugs, bugs.b185576, Lbugs.b185576.BasicTestBugs;, null, null, "+emptyPositions+R_DRICUNR+"}\n" + >+ "BasicTestBugs.X[TYPE_REF]{X, bugs.b185576, Lbugs.b185576.BasicTestBugs$X;, null, null, "+emptyPositions+R_DRICUNR+"}" >+ ); >+} > } >Index: src/org/eclipse/jdt/core/tests/model/AbstractJavadocCompletionModelTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavadocCompletionModelTest.java,v >retrieving revision 1.14 >diff -u -r1.14 AbstractJavadocCompletionModelTest.java >--- src/org/eclipse/jdt/core/tests/model/AbstractJavadocCompletionModelTest.java 6 Mar 2007 04:43:19 -0000 1.14 >+++ src/org/eclipse/jdt/core/tests/model/AbstractJavadocCompletionModelTest.java 14 May 2007 16:46:29 -0000 >@@ -347,10 +347,10 @@ > assertNoProblem(sources[0]); > > // Store replacement info >+ int endPosition = this.cursorLocation; > if (occurencePosition == 0) { // special case for completion on empty token... > this.completionStart = this.cursorLocation; > } >- int endPosition = this.cursorLocation; > char ch = source.charAt(endPosition); > if (Character.isJavaIdentifierPart(ch) || ch == '>' || ch == '}' || ch == '(' || ch == ')') { > do {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 185576
:
67072
| 67098