View | Details | Raw Unified | Return to bug 215976
Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/util/PublicScanner.java (-9 / +33 lines)
Lines 154-159 Link Here
154
	protected int nlsTagsPtr;
154
	protected int nlsTagsPtr;
155
	public boolean checkNonExternalizedStringLiterals;
155
	public boolean checkNonExternalizedStringLiterals;
156
	
156
	
157
	protected int lastPosistion;
158
	
157
	// generic support
159
	// generic support
158
	public boolean returnOnlyGreater = false;
160
	public boolean returnOnlyGreater = false;
159
	
161
	
Lines 204-212 Link Here
204
	this.sourceLevel = sourceLevel;
206
	this.sourceLevel = sourceLevel;
205
	this.complianceLevel = complianceLevel;
207
	this.complianceLevel = complianceLevel;
206
	this.checkNonExternalizedStringLiterals = checkNonExternalizedStringLiterals;
208
	this.checkNonExternalizedStringLiterals = checkNonExternalizedStringLiterals;
207
	this.taskTags = taskTags;
209
	if (taskTags != null) {
208
	this.taskPriorities = taskPriorities;
210
		int length = taskTags.length;
209
	this.isTaskCaseSensitive = isTaskCaseSensitive;
211
		if (taskPriorities != null) {
212
			int[] initialIndexes = new int[length];
213
			for (int i = 0; i < length; i++) {
214
				initialIndexes[i] = i;
215
			}
216
			Util.reverseQuickSort(taskTags, 0, taskTags.length - 1, initialIndexes);
217
			char[][] temp = new char[length][];
218
			for (int i = 0; i < length; i++) {
219
				temp[i] = taskPriorities[initialIndexes[i]];
220
			}
221
			this.taskPriorities = temp;
222
		} else {
223
			Util.reverseQuickSort(taskTags, 0, taskTags.length - 1);
224
		}
225
		this.taskTags = taskTags;
226
		this.isTaskCaseSensitive = isTaskCaseSensitive;
227
	}
210
}
228
}
211
229
212
public PublicScanner(
230
public PublicScanner(
Lines 270-277 Link Here
270
					char sc, tc;
288
					char sc, tc;
271
					int x = i+t;
289
					int x = i+t;
272
					if (x >= this.eofPosition || x >= commentEnd) continue nextTag;
290
					if (x >= this.eofPosition || x >= commentEnd) continue nextTag;
273
					if ((sc = src[i + t]) != (tc = tag[t])) { 																					// case sensitive check
291
					// case sensitive check
274
						if (this.isTaskCaseSensitive || (ScannerHelper.toLowerCase(sc) != ScannerHelper.toLowerCase(tc))) { 	// case insensitive check
292
					if ((sc = src[i + t]) != (tc = tag[t])) {
293
						// case insensitive check
294
						if (this.isTaskCaseSensitive || (ScannerHelper.toLowerCase(sc) != ScannerHelper.toLowerCase(tc))) {
275
							continue nextTag;
295
							continue nextTag;
276
						}
296
						}
277
					}
297
					}
Lines 1486-1492 Link Here
1486
								recordComment(TokenNameCOMMENT_LINE);
1506
								recordComment(TokenNameCOMMENT_LINE);
1487
								if (this.taskTags != null) checkTaskTag(this.startPosition, this.currentPosition);
1507
								if (this.taskTags != null) checkTaskTag(this.startPosition, this.currentPosition);
1488
								if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) {
1508
								if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) {
1489
									if (this.checkNonExternalizedStringLiterals) {
1509
									if (this.checkNonExternalizedStringLiterals &&
1510
											this.lastPosistion < this.currentPosition) {
1490
										parseTags();
1511
										parseTags();
1491
									}
1512
									}
1492
									if (this.recordLineSeparator) {
1513
									if (this.recordLineSeparator) {
Lines 1504-1510 Link Here
1504
								this.currentPosition--;
1525
								this.currentPosition--;
1505
								recordComment(TokenNameCOMMENT_LINE);
1526
								recordComment(TokenNameCOMMENT_LINE);
1506
								if (this.taskTags != null) checkTaskTag(this.startPosition, this.currentPosition);
1527
								if (this.taskTags != null) checkTaskTag(this.startPosition, this.currentPosition);
1507
								if (this.checkNonExternalizedStringLiterals) {
1528
								if (this.checkNonExternalizedStringLiterals &&
1529
										this.lastPosistion < this.currentPosition) {
1508
									parseTags();
1530
									parseTags();
1509
								}
1531
								}
1510
								if (this.tokenizeComments) {
1532
								if (this.tokenizeComments) {
Lines 1930-1936 Link Here
1930
								recordComment(TokenNameCOMMENT_LINE);
1952
								recordComment(TokenNameCOMMENT_LINE);
1931
								if (this.recordLineSeparator
1953
								if (this.recordLineSeparator
1932
									&& ((this.currentCharacter == '\r') || (this.currentCharacter == '\n'))) {
1954
									&& ((this.currentCharacter == '\r') || (this.currentCharacter == '\n'))) {
1933
										if (this.checkNonExternalizedStringLiterals) {
1955
										if (this.checkNonExternalizedStringLiterals &&
1956
												this.lastPosistion < this.currentPosition) {
1934
											parseTags();
1957
											parseTags();
1935
										}
1958
										}
1936
										if (this.recordLineSeparator) {
1959
										if (this.recordLineSeparator) {
Lines 1945-1951 Link Here
1945
								 //an eof will then be generated
1968
								 //an eof will then be generated
1946
								this.currentPosition--;
1969
								this.currentPosition--;
1947
								recordComment(TokenNameCOMMENT_LINE);
1970
								recordComment(TokenNameCOMMENT_LINE);
1948
								if (this.checkNonExternalizedStringLiterals) {
1971
								if (this.checkNonExternalizedStringLiterals &&
1972
										this.lastPosistion < this.currentPosition) {
1949
									parseTags();
1973
									parseTags();
1950
								}
1974
								}
1951
								if (!this.tokenizeComments) {
1975
								if (!this.tokenizeComments) {

Return to bug 215976