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 108189 Details for
Bug 106821
[assist] Code assist: Deprecated elements not marked
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated patch
bug106821_003.txt (text/plain), 13.23 KB, created by
David Audel
on 2008-07-23 09:22:57 EDT
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
David Audel
Created:
2008-07-23 09:22:57 EDT
Size:
13.23 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java,v >retrieving revision 1.30 >diff -u -r1.30 CompletionTestsRequestor2.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java 27 Jun 2008 16:02:40 -0000 1.30 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java 23 Jul 2008 13:21:26 -0000 >@@ -16,6 +16,7 @@ > import org.eclipse.jdt.core.CompletionContext; > import org.eclipse.jdt.core.CompletionProposal; > import org.eclipse.jdt.core.CompletionRequestor; >+import org.eclipse.jdt.core.Flags; > import org.eclipse.jdt.core.IJavaElement; > import org.eclipse.jdt.core.Signature; > import org.eclipse.jdt.core.compiler.IProblem; >@@ -36,6 +37,7 @@ > private boolean showTokenPositions; > private boolean shortContext; > private boolean showMissingTypes; >+ private boolean showModifiers; > > private boolean computeVisibleElements; > private boolean computeEnclosingElement; >@@ -63,9 +65,17 @@ > this(showParamNames, showUniqueKeys, showPositions, shortContext, showMissingTypes, false); > } > public CompletionTestsRequestor2(boolean showParamNames, boolean showUniqueKeys, boolean showPositions, boolean shortContext, boolean showMissingTypes, boolean showTokenPositions) { >- this(false, showParamNames, showUniqueKeys, showPositions, shortContext, showMissingTypes, showTokenPositions); >+ this(false, showParamNames, showUniqueKeys, showPositions, shortContext, showMissingTypes, showTokenPositions, false); > } >- public CompletionTestsRequestor2(boolean ignoreAll, boolean showParamNames, boolean showUniqueKeys, boolean showPositions, boolean shortContext, boolean showMissingTypes, boolean showTokenPositions) { >+ public CompletionTestsRequestor2( >+ boolean ignoreAll, >+ boolean showParamNames, >+ boolean showUniqueKeys, >+ boolean showPositions, >+ boolean shortContext, >+ boolean showMissingTypes, >+ boolean showTokenPositions, >+ boolean showModifiers) { > super(ignoreAll); > this.showParameterNames = showParamNames; > this.showUniqueKeys = showUniqueKeys; >@@ -73,6 +83,7 @@ > this.showTokenPositions = showTokenPositions; > this.shortContext = shortContext; > this.showMissingTypes = showMissingTypes; >+ this.showModifiers = showModifiers; > > } > public void acceptContext(CompletionContext cc) { >@@ -447,6 +458,14 @@ > buffer.append(proposal.getReceiverEnd()); > buffer.append("]"); > } >+ if(this.showModifiers) { >+ int flags = proposal.getFlags(); >+ buffer.append(", "); >+ buffer.append(Flags.toString(flags)); >+ if (Flags.isDeprecated(flags)) { >+ buffer.append(" deprecated"); //$NON-NLS-1$ >+ } >+ } > buffer.append(", "); > buffer.append(proposal.getRelevance()); > buffer.append('}'); >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java,v >retrieving revision 1.186 >diff -u -r1.186 CompletionTests.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 17 Jul 2008 09:57:28 -0000 1.186 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 23 Jul 2008 13:21:25 -0000 >@@ -4173,7 +4173,7 @@ > " }\n"+ > "}\n"); > >- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, true, false, true, true, false, true); >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, true, false, true, true, false, true, false); > String str = this.workingCopies[0].getSource(); > String completeBehind = "Objec"; > int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >Index: src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java,v >retrieving revision 1.106 >diff -u -r1.106 CompletionTests_1_5.java >--- src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 27 Jun 2008 16:02:39 -0000 1.106 >+++ src/org/eclipse/jdt/core/tests/model/CompletionTests_1_5.java 23 Jul 2008 13:21:35 -0000 >@@ -11982,6 +11982,39 @@ > "", > requestor.getResults()); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=106821 >+public void test0375() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[1]; >+ >+ this.workingCopies[0] = getWorkingCopy( >+ "/Completion/src/test/Test.java", >+ "package test;\n"+ >+ "public class Test\n"+ >+ "{\n"+ >+ " /**\n"+ >+ " * @deprecated\n"+ >+ " */\n"+ >+ " public void foo1() {\n"+ >+ " }\n"+ >+ " @Deprecated\n"+ >+ " public void foo2() {\n"+ >+ " }\n"+ >+ " {\n"+ >+ " foo\n"+ >+ " Thread.\n"+ >+ " }\n"+ >+ "}"); >+ CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(false, true, false, false, true, false, false, true); >+ String str = this.workingCopies[0].getSource(); >+ String completeBehind = "foo"; >+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); >+ this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); >+ >+ assertResults( >+ "foo1[METHOD_REF]{foo1(), Ltest.Test;, ()V, foo1, null, public deprecated, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" + >+ "foo2[METHOD_REF]{foo2(), Ltest.Test;, ()V, foo2, null, public deprecated, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", >+ requestor.getResults()); >+} > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=153130 > public void testEC001() throws JavaModelException { > this.workingCopies = new ICompilationUnit[1]; >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/util/PublicScanner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java,v >retrieving revision 1.105 >diff -u -r1.105 PublicScanner.java >--- model/org/eclipse/jdt/internal/core/util/PublicScanner.java 27 Jun 2008 16:03:57 -0000 1.105 >+++ model/org/eclipse/jdt/internal/core/util/PublicScanner.java 23 Jul 2008 13:21:42 -0000 >@@ -1605,7 +1605,7 @@ > star = true; > break; > case '@': >- if (firstTag == 0) { >+ if (firstTag == 0 && this.isFirstTag()) { > firstTag = previous; > } > // fall through default case to set star to false >@@ -1769,6 +1769,9 @@ > public char[] getSource(){ > return this.source; > } >+protected boolean isFirstTag() { >+ return true; >+} > public final void jumpOverMethodBody() { > > this.wasAcr = false; >@@ -2046,7 +2049,7 @@ > star = true; > break; > case '@': >- if (firstTag == 0) { >+ if (firstTag == 0 && this.isFirstTag()) { > firstTag = previous; > } > // fall through default case to set star to false >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java,v >retrieving revision 1.66 >diff -u -r1.66 CompletionScanner.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java 27 Jun 2008 16:03:59 -0000 1.66 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java 23 Jul 2008 13:21:38 -0000 >@@ -675,6 +675,7 @@ > try { //get the next char > boolean isJavadoc = false, star = false; > boolean isUnicode = false; >+ int previous; > // consume next character > this.unicodeAsBackSlash = false; > if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\') >@@ -701,6 +702,7 @@ > } > } > isUnicode = false; >+ previous = this.currentPosition; > if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\') > && (this.source[this.currentPosition] == 'u')) { > //-------------unicode traitement ------------ >@@ -719,6 +721,7 @@ > isJavadoc = false; > } > //loop until end of comment */ >+ int firstTag = 0; > while ((this.currentCharacter != '/') || (!star)) { > if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) { > //checkNonExternalizedString(); >@@ -727,9 +730,21 @@ > pushLineSeparator(); > } > } >+ } >+ switch (this.currentCharacter) { >+ case '*': >+ star = true; >+ break; >+ case '@': >+ if (firstTag == 0 && this.isFirstTag()) { >+ firstTag = previous; >+ } >+ // fall through default case to set star to false >+ default: >+ star = false; > } >- star = this.currentCharacter == '*'; >- //get next char >+ //get next char >+ previous = this.currentPosition; > if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\') > && (this.source[this.currentPosition] == 'u')) { > //-------------unicode traitement ------------ >@@ -746,6 +761,7 @@ > } > int token = isJavadoc ? TokenNameCOMMENT_JAVADOC : TokenNameCOMMENT_BLOCK; > recordComment(token); >+ this.commentTagStarts[this.commentPtr] = firstTag; > if (!isJavadoc && this.startPosition <= this.cursorLocation && this.cursorLocation < this.currentPosition-1){ > throw new InvalidCursorLocation(InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT); > } >@@ -810,6 +826,19 @@ > throw new InvalidCursorLocation(InvalidCursorLocation.NO_COMPLETION_INSIDE_UNICODE); > } > } >+protected boolean isFirstTag() { >+ return >+ getNextChar('d') && >+ getNextChar('e') && >+ getNextChar('p') && >+ getNextChar('r') && >+ getNextChar('e') && >+ getNextChar('c') && >+ getNextChar('a') && >+ getNextChar('t') && >+ getNextChar('e') && >+ getNextChar('d'); >+} > public final void jumpOverBlock() { > jumpOverMethodBody(); > } >Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java,v >retrieving revision 1.30 >diff -u -r1.30 CompletionJavadocParser.java >--- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java 27 Jun 2008 16:03:59 -0000 1.30 >+++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java 23 Jul 2008 13:21:37 -0000 >@@ -64,6 +64,8 @@ > * Do not parse comment if completion location is not included. > */ > public boolean checkDeprecation(int commentPtr) { >+ boolean isDeprecated = false; >+ > this.cursorLocation = ((CompletionParser)this.sourceParser).cursorLocation; > CompletionScanner completionScanner = (CompletionScanner)this.scanner; > completionScanner.cursorLocation = this.cursorLocation; >@@ -77,9 +79,15 @@ > this.firstTagPosition = 1; > super.checkDeprecation(commentPtr); > } else { >+ if (this.sourceParser.scanner.commentTagStarts[commentPtr] != 0) { >+ boolean previousValue = this.checkDocComment; >+ this.checkDocComment = false; >+ isDeprecated = super.checkDeprecation(commentPtr); >+ this.checkDocComment = previousValue; >+ } > this.docComment = null; > } >- return false; >+ return isDeprecated; > } > > /* >Index: compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java,v >retrieving revision 1.191 >diff -u -r1.191 Scanner.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java 27 Jun 2008 16:03:51 -0000 1.191 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java 23 Jul 2008 13:21:39 -0000 >@@ -1608,7 +1608,7 @@ > star = true; > break; > case '@': >- if (firstTag == 0) { >+ if (firstTag == 0 && this.isFirstTag()) { > firstTag = previous; > } > // fall through default case to set star to false >@@ -1772,6 +1772,9 @@ > public char[] getSource(){ > return this.source; > } >+protected boolean isFirstTag() { >+ return true; >+} > public final void jumpOverMethodBody() { > > this.wasAcr = false; >@@ -2049,7 +2052,7 @@ > star = true; > break; > case '@': >- if (firstTag == 0) { >+ if (firstTag == 0 && this.isFirstTag()) { > firstTag = previous; > } > // fall through default case to set star to false
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 106821
:
98134
| 108189