View | Details | Raw Unified | Return to bug 106821 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/util/PublicScanner.java (-2 / +5 lines)
Lines 1604-1610 Link Here
1604
											star = true;
1604
											star = true;
1605
											break;
1605
											break;
1606
										case '@':
1606
										case '@':
1607
											if (firstTag == 0) {
1607
											if (firstTag == 0 && this.isFirstTag()) {
1608
												firstTag = previous;
1608
												firstTag = previous;
1609
											}
1609
											}
1610
											// fall through default case to set star to false
1610
											// fall through default case to set star to false
Lines 1768-1773 Link Here
1768
public char[] getSource(){
1768
public char[] getSource(){
1769
	return this.source;
1769
	return this.source;
1770
}
1770
}
1771
protected boolean isFirstTag() {
1772
	return true;
1773
}
1771
public final void jumpOverMethodBody() {
1774
public final void jumpOverMethodBody() {
1772
1775
1773
	this.wasAcr = false;
1776
	this.wasAcr = false;
Lines 2045-2051 Link Here
2045
											star = true;
2048
											star = true;
2046
											break;
2049
											break;
2047
										case '@':
2050
										case '@':
2048
											if (firstTag == 0) {
2051
											if (firstTag == 0 && this.isFirstTag()) {
2049
												firstTag = previous;
2052
												firstTag = previous;
2050
											}
2053
											}
2051
											// fall through default case to set star to false
2054
											// fall through default case to set star to false
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionScanner.java (-2 / +32 lines)
Lines 675-680 Link Here
675
							try { //get the next char
675
							try { //get the next char
676
								boolean isJavadoc = false, star = false;
676
								boolean isJavadoc = false, star = false;
677
								boolean isUnicode = false;
677
								boolean isUnicode = false;
678
								int previous;
678
								// consume next character
679
								// consume next character
679
								this.unicodeAsBackSlash = false;
680
								this.unicodeAsBackSlash = false;
680
								if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
681
								if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
Lines 701-706 Link Here
701
									}
702
									}
702
								}
703
								}
703
								isUnicode = false;
704
								isUnicode = false;
705
								previous = this.currentPosition;
704
								if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
706
								if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
705
									&& (this.source[this.currentPosition] == 'u')) {
707
									&& (this.source[this.currentPosition] == 'u')) {
706
									//-------------unicode traitement ------------
708
									//-------------unicode traitement ------------
Lines 718-724 Link Here
718
								if (this.currentCharacter == '/') { 
720
								if (this.currentCharacter == '/') { 
719
									isJavadoc = false;
721
									isJavadoc = false;
720
								}
722
								}
721
								//loop until end of comment */ 
723
								//loop until end of comment */
724
								int firstTag = 0;
722
								while ((this.currentCharacter != '/') || (!star)) {
725
								while ((this.currentCharacter != '/') || (!star)) {
723
									if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) {
726
									if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) {
724
										//checkNonExternalizedString();
727
										//checkNonExternalizedString();
Lines 728-735 Link Here
728
											}
731
											}
729
										}
732
										}
730
									}
733
									}
731
									star = this.currentCharacter == '*';
734
									
735
									switch (this.currentCharacter) {
736
										case '*':
737
											star = true;
738
											break;
739
										case '@':
740
											if (firstTag == 0 && this.isFirstTag()) {
741
												firstTag = previous;
742
											}
743
											// fall through default case to set star to false
744
										default:
745
											star = false;
746
									}
732
									//get next char
747
									//get next char
748
									previous = this.currentPosition;
733
									if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
749
									if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
734
										&& (this.source[this.currentPosition] == 'u')) {
750
										&& (this.source[this.currentPosition] == 'u')) {
735
										//-------------unicode traitement ------------
751
										//-------------unicode traitement ------------
Lines 746-751 Link Here
746
								}
762
								}
747
								int token = isJavadoc ? TokenNameCOMMENT_JAVADOC : TokenNameCOMMENT_BLOCK;
763
								int token = isJavadoc ? TokenNameCOMMENT_JAVADOC : TokenNameCOMMENT_BLOCK;
748
								recordComment(token);
764
								recordComment(token);
765
								this.commentTagStarts[this.commentPtr] = firstTag;
749
								if (!isJavadoc && this.startPosition <= this.cursorLocation && this.cursorLocation < this.currentPosition-1){
766
								if (!isJavadoc && this.startPosition <= this.cursorLocation && this.cursorLocation < this.currentPosition-1){
750
									throw new InvalidCursorLocation(InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
767
									throw new InvalidCursorLocation(InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
751
								}
768
								}
Lines 810-815 Link Here
810
		throw new InvalidCursorLocation(InvalidCursorLocation.NO_COMPLETION_INSIDE_UNICODE);
827
		throw new InvalidCursorLocation(InvalidCursorLocation.NO_COMPLETION_INSIDE_UNICODE);
811
	}
828
	}
812
}
829
}
830
protected boolean isFirstTag() {
831
	return
832
		getNextChar('d') &&
833
		getNextChar('e') &&
834
		getNextChar('p') &&
835
		getNextChar('r') &&
836
		getNextChar('e') &&
837
		getNextChar('c') &&
838
		getNextChar('a') &&
839
		getNextChar('t') &&
840
		getNextChar('e') &&
841
		getNextChar('d');
842
}
813
public final void jumpOverBlock() {
843
public final void jumpOverBlock() {
814
	this.jumpOverMethodBody();
844
	this.jumpOverMethodBody();
815
}
845
}
(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.java (-1 / +9 lines)
Lines 64-69 Link Here
64
	 * Do not parse comment if completion location is not included.
64
	 * Do not parse comment if completion location is not included.
65
	 */
65
	 */
66
	public boolean checkDeprecation(int commentPtr) {
66
	public boolean checkDeprecation(int commentPtr) {
67
		boolean isDeprecated = false;
68
		
67
		this.cursorLocation = ((CompletionParser)sourceParser).cursorLocation;
69
		this.cursorLocation = ((CompletionParser)sourceParser).cursorLocation;
68
		CompletionScanner completionScanner = (CompletionScanner)this.scanner;
70
		CompletionScanner completionScanner = (CompletionScanner)this.scanner;
69
		completionScanner.cursorLocation = this.cursorLocation;
71
		completionScanner.cursorLocation = this.cursorLocation;
Lines 77-85 Link Here
77
			this.firstTagPosition = 1;
79
			this.firstTagPosition = 1;
78
			super.checkDeprecation(commentPtr);
80
			super.checkDeprecation(commentPtr);
79
		} else {
81
		} else {
82
			if (this.sourceParser.scanner.commentTagStarts[commentPtr] != 0) {
83
				boolean previousValue = this.checkDocComment;
84
				this.checkDocComment = false;
85
				isDeprecated = super.checkDeprecation(commentPtr);
86
				this.checkDocComment = previousValue;
87
			}
80
			this.docComment = null;
88
			this.docComment = null;
81
		}
89
		}
82
		return false;
90
		return isDeprecated;
83
	}
91
	}
84
92
85
	/*
93
	/*
(-)compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java (-2 / +5 lines)
Lines 1608-1614 Link Here
1608
											star = true;
1608
											star = true;
1609
											break;
1609
											break;
1610
										case '@':
1610
										case '@':
1611
											if (firstTag == 0) {
1611
											if (firstTag == 0 && this.isFirstTag()) {
1612
												firstTag = previous;
1612
												firstTag = previous;
1613
											}
1613
											}
1614
											// fall through default case to set star to false
1614
											// fall through default case to set star to false
Lines 1772-1777 Link Here
1772
public char[] getSource(){
1772
public char[] getSource(){
1773
	return this.source;
1773
	return this.source;
1774
}
1774
}
1775
protected boolean isFirstTag() {
1776
	return true;
1777
}
1775
public final void jumpOverMethodBody() {
1778
public final void jumpOverMethodBody() {
1776
1779
1777
	this.wasAcr = false;
1780
	this.wasAcr = false;
Lines 2049-2055 Link Here
2049
											star = true;
2052
											star = true;
2050
											break;
2053
											break;
2051
										case '@':
2054
										case '@':
2052
											if (firstTag == 0) {
2055
											if (firstTag == 0 && this.isFirstTag()) {
2053
												firstTag = previous;
2056
												firstTag = previous;
2054
											}
2057
											}
2055
											// fall through default case to set star to false
2058
											// fall through default case to set star to false

Return to bug 106821