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 134737 Details for
Bug 255752
[javadoc][assist] Inappropriate completion proposals for javadoc at compilation unit level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Proposed patch
bug_255752_2.txt (text/plain), 5.39 KB, created by
Jay Arthanareeswaran
on 2009-05-07 01:54:12 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2009-05-07 01:54:12 EDT
Size:
5.39 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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.26 >diff -u -r1.26 JavadocBugsCompletionModelTest.java >--- src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java 24 Oct 2008 15:29:59 -0000 1.26 >+++ src/org/eclipse/jdt/core/tests/model/JavadocBugsCompletionModelTest.java 7 May 2009 05:49:38 -0000 >@@ -1129,4 +1129,46 @@ > "field[FIELD_REF]{field, Lbugs.b171016.BasicTestBugs;, I, field, null, "+this.positions+R_DRICNRNS+"}" > ); > } >+/** >+ * @bug 255752 [javadoc][assist] Inappropriate completion proposals for javadoc at compilation unit level >+ * @test that there are no tag completions offered at the compilation unit level for a non package-info.java >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=255752" >+ */ >+public void testBug255752() throws JavaModelException { >+ String source = >+ "/**\n" + >+ " *\n" + >+ " * @\n" + >+ " */" + >+ "package javadoc.bugs;\n" + >+ "public class BasicTestBugs {}\n"; >+ completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.java", source, true, "@", -1); >+ assertSortedResults(""); >+} >+/** >+ * Additional tests for bug 255752 >+ * @test whether an orphan Javadoc comment gets all the possible tags applicable to the class level. >+ */ >+public void testBug255752a() throws JavaModelException { >+ String source = >+ "/**\n" + >+ " *\n" + >+ " * @\n" + >+ " */" + >+ "\n"; >+ completeInJavadoc("/Completion/src/javadoc/bugs/BasicTestBugs.java", source, true, "@", -1); >+ assertResults( >+ "author[JAVADOC_BLOCK_TAG]{@author, null, null, author, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" + >+ "deprecated[JAVADOC_BLOCK_TAG]{@deprecated, null, null, deprecated, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" + >+ "see[JAVADOC_BLOCK_TAG]{@see, null, null, see, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" + >+ "version[JAVADOC_BLOCK_TAG]{@version, null, null, version, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" + >+ "category[JAVADOC_BLOCK_TAG]{@category, null, null, category, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" + >+ "since[JAVADOC_BLOCK_TAG]{@since, null, null, since, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" + >+ "serial[JAVADOC_BLOCK_TAG]{@serial, null, null, serial, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" + >+ "link[JAVADOC_INLINE_TAG]{{@link}, null, null, link, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" + >+ "docRoot[JAVADOC_INLINE_TAG]{{@docRoot}, null, null, docRoot, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" + >+ "linkplain[JAVADOC_INLINE_TAG]{{@linkplain}, null, null, linkplain, null, "+this.positions+JAVADOC_RELEVANCE+"}\n" + >+ "value[JAVADOC_INLINE_TAG]{{@value}, null, null, value, null, "+this.positions+JAVADOC_RELEVANCE+"}" >+ ); >+} > } >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java,v >retrieving revision 1.7 >diff -u -r1.7 CompletionOnJavadocTag.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java 7 Mar 2009 00:58:59 -0000 1.7 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocTag.java 7 May 2009 05:49:41 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.jdt.internal.codeassist.complete; > > import org.eclipse.jdt.core.compiler.CharOperation; >+import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; > import org.eclipse.jdt.internal.compiler.ast.JavadocSingleNameReference; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.lookup.ClassScope; >@@ -89,6 +90,17 @@ > char[][] specifiedTags = null; > switch (kind) { > case Scope.COMPILATION_UNIT_SCOPE: >+ // bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=255752 >+ // Check for FAKE_TYPE_NAME to allow proposals (@see CompletionParser#consumeCompilationUnit) >+ CompilationUnitDeclaration compilationUnit = scope.referenceCompilationUnit(); >+ if (compilationUnit != null && >+ (compilationUnit.isPackageInfo() || >+ (compilationUnit.types.length > 0 && compilationUnit.types[0].name == CompletionParser.FAKE_TYPE_NAME))) { >+ specifiedTags = CLASS_TAGS; >+ } else { >+ specifiedTags = COMPILATION_UNIT_TAGS; >+ } >+ break; > case Scope.CLASS_SCOPE: > specifiedTags = CLASS_TAGS; > break; >Index: compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java,v >retrieving revision 1.20 >diff -u -r1.20 JavadocTagConstants.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java 28 Apr 2009 16:53:02 -0000 1.20 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java 7 May 2009 05:49:41 -0000 >@@ -212,6 +212,7 @@ > TAG_DOC_ROOT, > TAG_VALUE, > }; >+ public static final char[][] COMPILATION_UNIT_TAGS = {}; > public static final char[][] CLASS_TAGS = { > TAG_SEE, > TAG_SINCE,
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 Raw
Actions:
View
Attachments on
bug 255752
:
134737
|
134738
|
135328