### Eclipse Workspace Patch 1.0 #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.102 diff -u -r1.102 PublicScanner.java --- model/org/eclipse/jdt/internal/core/util/PublicScanner.java 22 Jan 2008 08:30:52 -0000 1.102 +++ model/org/eclipse/jdt/internal/core/util/PublicScanner.java 30 Apr 2008 08:42:51 -0000 @@ -1604,7 +1604,7 @@ star = true; break; case '@': - if (firstTag == 0) { + if (firstTag == 0 && this.isFirstTag()) { firstTag = previous; } // fall through default case to set star to false @@ -1768,6 +1768,9 @@ public char[] getSource(){ return this.source; } +protected boolean isFirstTag() { + return true; +} public final void jumpOverMethodBody() { this.wasAcr = false; @@ -2045,7 +2048,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.65 diff -u -r1.65 CompletionScanner.java --- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java 12 Apr 2007 09:23:29 -0000 1.65 +++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java 30 Apr 2008 08:42:50 -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 ------------ @@ -718,7 +720,8 @@ if (this.currentCharacter == '/') { isJavadoc = false; } - //loop until end of comment */ + //loop until end of comment */ + int firstTag = 0; while ((this.currentCharacter != '/') || (!star)) { if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) { //checkNonExternalizedString(); @@ -728,8 +731,21 @@ } } } - star = this.currentCharacter == '*'; + + 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; + } //get next char + previous = this.currentPosition; if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\') && (this.source[this.currentPosition] == 'u')) { //-------------unicode traitement ------------ @@ -746,6 +762,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 +827,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() { this.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.29 diff -u -r1.29 CompletionJavadocParser.java --- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java 4 Oct 2007 13:02:03 -0000 1.29 +++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java 30 Apr 2008 08:42:50 -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)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.190 diff -u -r1.190 Scanner.java --- compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java 14 Apr 2008 21:52:39 -0000 1.190 +++ compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java 30 Apr 2008 08:42:51 -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