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

(-)compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java (-215 / +213 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 429-669 Link Here
429
		}
429
		}
430
		this.tagWaitingForDescription = NO_TAG_VALUE;
430
		this.tagWaitingForDescription = NO_TAG_VALUE;
431
431
432
		// Read tag name
432
		// Verify first character
433
		this.tagSourceStart = this.index;
434
		this.tagSourceEnd = previousPosition;
435
		this.scanner.startPosition = this.index;
433
		int currentPosition = this.index;
436
		int currentPosition = this.index;
434
		int token = readTokenAndConsume();
437
		char firstChar = readChar();
435
	    if (currentPosition != this.scanner.startPosition) {
438
		switch (firstChar) {
436
			this.tagSourceStart = previousPosition;
439
			case ' ':
437
			this.tagSourceEnd = currentPosition;
440
			case '*':
438
			if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidTag(this.tagSourceStart, this.tagSourceEnd);
441
			case '}':
439
			return false;
442
			case '#':
440
		}
443
				// the first character is not valid, hence report invalid empty tag
441
		if (this.index >= this.scanner.eofPosition) {
444
				if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidTag(previousPosition, currentPosition);
442
			this.tagSourceStart = previousPosition;
445
				if (this.textStart == -1) this.textStart = currentPosition;
443
			this.tagSourceEnd = this.tokenPreviousPosition;
446
				this.scanner.currentCharacter = firstChar;
444
			if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidTag(this.tagSourceStart, this.tagSourceEnd);
445
			return false;
446
		}
447
		this.tagSourceStart = this.scanner.getCurrentTokenStartPosition();
448
		this.tagSourceEnd = this.scanner.getCurrentTokenEndPosition();
449
		char[] tagName = this.scanner.getCurrentIdentifierSource();
450
451
		// Try to get tag name other than java identifier
452
		// (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=51660)
453
		if (this.scanner.currentCharacter != ' ' && !ScannerHelper.isWhitespace(this.scanner.currentCharacter)) {
454
			boolean validTag = true;
455
			tagNameToken: while (token != TerminalTokens.TokenNameEOF && this.index < this.scanner.eofPosition) {
456
				int length = tagName.length;
457
				// !, ", #, %, &, ', -, :, <, >, * chars and spaces are not allowed in tag names
458
				switch (this.scanner.currentCharacter) {
459
					case '}':
460
					case '*': // break for '*' as this is perhaps the end of comment (bug 65288)
461
						break tagNameToken;
462
					case '!':
463
					case '#':
464
					case '%':
465
					case '&':
466
					case '\'':
467
					case '"':
468
					case ':':
469
					case '<':
470
					case '>':
471
					case '@':
472
						validTag = false;
473
						this.tagSourceEnd = this.scanner.getCurrentTokenEndPosition();
474
						this.index = this.scanner.currentPosition;
475
						break;
476
					case '-': // allowed in tag names as this character is often used in doclets (bug 68087)
477
						System.arraycopy(tagName, 0, tagName = new char[length+1], 0, length);
478
						tagName[length] = this.scanner.currentCharacter;
479
						this.tagSourceEnd = this.scanner.getCurrentTokenEndPosition();
480
						this.index = this.scanner.currentPosition;
481
						break;
482
					default:
483
						if (this.scanner.currentCharacter == ' ' || ScannerHelper.isWhitespace(this.scanner.currentCharacter)) {
484
							break tagNameToken;
485
						}
486
						token = readTokenAndConsume();
487
						char[] ident = this.scanner.getCurrentIdentifierSource();
488
						System.arraycopy(tagName, 0, tagName = new char[length+ident.length], 0, length);
489
						System.arraycopy(ident, 0, tagName, length, ident.length);
490
						this.tagSourceEnd = this.scanner.getCurrentTokenEndPosition();
491
						break;
492
				}
493
				this.scanner.getNextChar();
494
			}
495
			if (!validTag) {
496
				if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidTag(this.tagSourceStart, this.tagSourceEnd);
497
				return false;
447
				return false;
448
			default:
449
				if (ScannerHelper.isWhitespace(firstChar)) {
450
					// the first character is not valid, hence report invalid empty tag
451
					if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidTag(previousPosition, currentPosition);
452
					if (this.textStart == -1) this.textStart = currentPosition;
453
					this.scanner.currentCharacter = firstChar;
454
					return false;
455
				}
456
				break;
457
		}
458
		
459
		// Read tag name
460
		char[] tagName = new char[32];
461
		int length = 0;
462
		char currentChar = firstChar;
463
		int tagNameLength = tagName.length;
464
		boolean validTag = true;
465
		tagLoop: while (true) {
466
			if (length == tagNameLength) {
467
				System.arraycopy(tagName, 0, tagName = new char[tagNameLength+32], 0, tagNameLength);
468
				tagNameLength = tagName.length;
469
			}
470
			tagName[length++] = currentChar;
471
			currentPosition = this.index;
472
			currentChar = readChar();
473
			switch (currentChar) {
474
				case ' ':
475
				case '*':
476
				case '}':
477
					// these characters mark the end of the tag reading
478
					break tagLoop;
479
				case '#':
480
					// invalid tag character, mark the tag as invalid but continue until the end of the tag
481
					validTag = false;
482
					break;
483
				default:
484
					if (ScannerHelper.isWhitespace(currentChar)) {
485
						// whitespace characters mark the end of the tag reading
486
						break tagLoop;
487
					}
488
					break;
498
			}
489
			}
499
		}
490
		}
500
		int length = tagName.length;
491
501
		if (length == 0) return false; // may happen for some parser (completion for example)
492
		// Init positions
493
		this.tagSourceEnd = currentPosition - 1;
494
		this.scanner.currentCharacter = currentChar;
495
		this.scanner.currentPosition = currentPosition;
502
		this.index = this.tagSourceEnd+1;
496
		this.index = this.tagSourceEnd+1;
503
		this.scanner.currentPosition = this.tagSourceEnd+1;
497
504
		if ((this.kind & FORMATTER_COMMENT_PARSER) != 0) {
498
		// Return if the tag is not valid
505
			this.tagSourceStart = previousPosition;
499
		if (!validTag) {
500
			if (this.reportProblems) this.sourceParser.problemReporter().javadocInvalidTag(this.tagSourceStart, this.tagSourceEnd);
501
			if (this.textStart == -1) this.textStart = this.index;
502
			this.scanner.currentCharacter = currentChar;
503
			return false;
506
		}
504
		}
507
505
508
		// Decide which parse to perform depending on tag name
506
		// Decide which parse to perform depending on tag name
509
		this.tagValue = TAG_OTHERS_VALUE;
507
		this.tagValue = TAG_OTHERS_VALUE;
510
		boolean valid = false;
508
		boolean valid = false;
511
		switch (token) {
509
		switch (firstChar) {
512
			case TerminalTokens.TokenNameIdentifier :
510
			case 'a':
513
				switch (tagName[0]) {
511
				if (length == TAG_AUTHOR_LENGTH && CharOperation.equals(TAG_AUTHOR, tagName, 0, length)) {
514
					case 'a':
512
					this.tagValue = TAG_AUTHOR_VALUE;
515
						if (length == TAG_AUTHOR_LENGTH && CharOperation.equals(TAG_AUTHOR, tagName)) {
513
					this.tagWaitingForDescription = this.tagValue;
516
							this.tagValue = TAG_AUTHOR_VALUE;
514
				}
517
							this.tagWaitingForDescription = this.tagValue;
515
				break;
518
						}
516
			case 'c':
519
						break;
517
				if (length == TAG_CATEGORY_LENGTH && CharOperation.equals(TAG_CATEGORY, tagName, 0, length)) {
520
					case 'c':
518
					this.tagValue = TAG_CATEGORY_VALUE;
521
						if (length == TAG_CATEGORY_LENGTH && CharOperation.equals(TAG_CATEGORY, tagName)) {
519
					valid = parseIdentifierTag(false); // TODO (frederic) reconsider parameter value when @category will be significant in spec
522
							this.tagValue = TAG_CATEGORY_VALUE;
520
				} else if (length == TAG_CODE_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_CODE, tagName, 0, length)) {
523
							valid = parseIdentifierTag(false); // TODO (frederic) reconsider parameter value when @category will be significant in spec
521
					this.tagValue = TAG_CODE_VALUE;
524
						} else if (length == TAG_CODE_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_CODE, tagName)) {
522
					this.tagWaitingForDescription = this.tagValue;
525
							this.tagValue = TAG_CODE_VALUE;
523
				}
526
							this.tagWaitingForDescription = this.tagValue;
524
				break;
527
						}
525
			case 'd':
528
						break;
526
				if (length == TAG_DEPRECATED_LENGTH && CharOperation.equals(TAG_DEPRECATED, tagName, 0, length)) {
529
					case 'd':
527
					this.deprecated = true;
530
						if (length == TAG_DEPRECATED_LENGTH && CharOperation.equals(TAG_DEPRECATED, tagName)) {
528
					valid = true;
531
							this.deprecated = true;
529
					this.tagValue = TAG_DEPRECATED_VALUE;
532
							valid = true;
530
					this.tagWaitingForDescription = this.tagValue;
533
							this.tagValue = TAG_DEPRECATED_VALUE;
531
				} else if (length == TAG_DOC_ROOT_LENGTH && CharOperation.equals(TAG_DOC_ROOT, tagName, 0, length)) {
534
							this.tagWaitingForDescription = this.tagValue;
532
					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=227730
535
						} else if (length == TAG_DOC_ROOT_LENGTH && CharOperation.equals(TAG_DOC_ROOT, tagName)) {
533
					// identify @docRoot tag as a base tag that does not expect any argument
536
							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=227730
534
					valid = true;
537
							// identify @docRoot tag as a base tag that does not expect any argument
535
					this.tagValue = TAG_DOC_ROOT_VALUE;
538
							valid = true;
536
				}
539
							this.tagValue = TAG_DOC_ROOT_VALUE;
537
				break;
540
						}
538
			case 'e':
541
						break;
539
				if (length == TAG_EXCEPTION_LENGTH && CharOperation.equals(TAG_EXCEPTION, tagName, 0, length)) {
542
					case 'e':
540
					this.tagValue = TAG_EXCEPTION_VALUE;
543
						if (length == TAG_EXCEPTION_LENGTH && CharOperation.equals(TAG_EXCEPTION, tagName)) {
541
					valid = parseThrows();
544
							this.tagValue = TAG_EXCEPTION_VALUE;
542
				}
545
							valid = parseThrows();
543
				break;
544
			case 'i':
545
				if (length == TAG_INHERITDOC_LENGTH && CharOperation.equals(TAG_INHERITDOC, tagName, 0, length)) {
546
					// inhibits inherited flag when tags have been already stored
547
					// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=51606
548
					// Note that for DOM_PARSER, nodes stack may be not empty even no '@' tag
549
					// was encountered in comment. But it cannot be the case for COMPILER_PARSER
550
					// and so is enough as it is only this parser which signals the missing tag warnings...
551
					if (this.astPtr==-1) {
552
						this.inheritedPositions = (((long) this.tagSourceStart) << 32) + this.tagSourceEnd;
553
					}
554
					valid = true;
555
					this.tagValue = TAG_INHERITDOC_VALUE;
556
				}
557
				break;
558
			case 'l':
559
				if (length == TAG_LINK_LENGTH && CharOperation.equals(TAG_LINK, tagName, 0, length)) {
560
					this.tagValue = TAG_LINK_VALUE;
561
					if (this.inlineTagStarted || (this.kind & COMPLETION_PARSER) != 0) {
562
						valid= parseReference();
563
					} else {
564
						// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=53290
565
						// Cannot have @link outside inline comment
566
						valid = false;
567
						if (this.reportProblems) {
568
							this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
546
						}
569
						}
547
						break;
570
					}
548
					case 'i':
571
				} else if (length == TAG_LINKPLAIN_LENGTH && CharOperation.equals(TAG_LINKPLAIN, tagName, 0, length)) {
549
						if (length == TAG_INHERITDOC_LENGTH && CharOperation.equals(TAG_INHERITDOC, tagName)) {
572
					this.tagValue = TAG_LINKPLAIN_VALUE;
550
							// inhibits inherited flag when tags have been already stored
573
					if (this.inlineTagStarted) {
551
							// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=51606
574
						valid = parseReference();
552
							// Note that for DOM_PARSER, nodes stack may be not empty even no '@' tag
575
					} else {
553
							// was encountered in comment. But it cannot be the case for COMPILER_PARSER
576
						valid = false;
554
							// and so is enough as it is only this parser which signals the missing tag warnings...
577
						if (this.reportProblems) {
555
							if (this.astPtr==-1) {
578
							this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
556
								this.inheritedPositions = (((long) this.tagSourceStart) << 32) + this.tagSourceEnd;
557
							}
558
							valid = true;
559
							this.tagValue = TAG_INHERITDOC_VALUE;
560
						}
579
						}
561
						break;
580
					}
562
					case 'l':
581
				} else if (length == TAG_LITERAL_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_LITERAL, tagName, 0, length)) {
563
						if (length == TAG_LINK_LENGTH && CharOperation.equals(TAG_LINK, tagName)) {
582
					this.tagValue = TAG_LITERAL_VALUE;
564
							this.tagValue = TAG_LINK_VALUE;
583
					this.tagWaitingForDescription = this.tagValue;
565
							if (this.inlineTagStarted || (this.kind & COMPLETION_PARSER) != 0) {
584
				}
566
								valid= parseReference();
585
				break;
567
							} else {
586
			case 'p':
568
								// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=53290
587
				if (length == TAG_PARAM_LENGTH && CharOperation.equals(TAG_PARAM, tagName, 0, length)) {
569
								// Cannot have @link outside inline comment
588
					this.tagValue = TAG_PARAM_VALUE;
570
								valid = false;
589
					valid = parseParam();
571
								if (this.reportProblems) {
590
				}
572
									this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
591
				break;
573
								}
592
			case 'r':
574
							}
593
				if (length == TAG_RETURN_LENGTH && CharOperation.equals(TAG_RETURN, tagName, 0, length)) {
575
						} else if (length == TAG_LINKPLAIN_LENGTH && CharOperation.equals(TAG_LINKPLAIN, tagName)) {
594
					this.tagValue = TAG_RETURN_VALUE;
576
							this.tagValue = TAG_LINKPLAIN_VALUE;
595
					valid = parseReturn();
577
							if (this.inlineTagStarted) {
596
				}
578
								valid = parseReference();
597
				break;
579
							} else {
598
			case 's':
580
								valid = false;
599
				if (length == TAG_SEE_LENGTH && CharOperation.equals(TAG_SEE, tagName, 0, length)) {
581
								if (this.reportProblems) {
600
					if (this.inlineTagStarted) {
582
									this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
601
						// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=53290
583
								}
602
						// Cannot have @see inside inline comment
584
							}
603
						valid = false;
585
						} else if (length == TAG_LITERAL_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_LITERAL, tagName)) {
604
						if (this.reportProblems) {
586
							this.tagValue = TAG_LITERAL_VALUE;
605
							this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
587
							this.tagWaitingForDescription = this.tagValue;
588
						}
606
						}
589
						break;
607
					} else {
590
					case 'p':
608
						this.tagValue = TAG_SEE_VALUE;
591
						if (length == TAG_PARAM_LENGTH && CharOperation.equals(TAG_PARAM, tagName)) {
609
						valid = parseReference();
592
							this.tagValue = TAG_PARAM_VALUE;
610
					}
593
							valid = parseParam();
611
				} else if (length == TAG_SERIAL_LENGTH && CharOperation.equals(TAG_SERIAL, tagName, 0, length)) {
612
					this.tagValue = TAG_SERIAL_VALUE;
613
					this.tagWaitingForDescription = this.tagValue;
614
				} else if (length == TAG_SERIAL_DATA_LENGTH && CharOperation.equals(TAG_SERIAL_DATA, tagName, 0, length)) {
615
					this.tagValue = TAG_SERIAL_DATA_VALUE;
616
					this.tagWaitingForDescription = this.tagValue;
617
				} else if (length == TAG_SERIAL_FIELD_LENGTH && CharOperation.equals(TAG_SERIAL_FIELD, tagName, 0, length)) {
618
					this.tagValue = TAG_SERIAL_FIELD_VALUE;
619
					this.tagWaitingForDescription = this.tagValue;
620
				} else if (length == TAG_SINCE_LENGTH && CharOperation.equals(TAG_SINCE, tagName, 0, length)) {
621
					this.tagValue = TAG_SINCE_VALUE;
622
					this.tagWaitingForDescription = this.tagValue;
623
				}
624
				break;
625
			case 't':
626
				if (length == TAG_THROWS_LENGTH && CharOperation.equals(TAG_THROWS, tagName, 0, length)) {
627
					this.tagValue = TAG_THROWS_VALUE;
628
					valid = parseThrows();
629
				}
630
				break;
631
			case 'v':
632
				if (length == TAG_VALUE_LENGTH && CharOperation.equals(TAG_VALUE, tagName, 0, length)) {
633
					this.tagValue = TAG_VALUE_VALUE;
634
					if (this.sourceLevel >= ClassFileConstants.JDK1_5) {
635
						if (this.inlineTagStarted) {
636
							valid = parseReference();
637
						} else {
638
							valid = false;
639
							if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
594
						}
640
						}
595
						break;
641
					} else {
596
					case 's':
642
						if (this.validValuePositions == -1) {
597
						if (length == TAG_SEE_LENGTH && CharOperation.equals(TAG_SEE, tagName)) {
643
							if (this.invalidValuePositions != -1) {
598
							if (this.inlineTagStarted) {
644
								if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag((int) (this.invalidValuePositions>>>32), (int) this.invalidValuePositions);
599
								// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=53290
600
								// Cannot have @see inside inline comment
601
								valid = false;
602
								if (this.reportProblems) {
603
									this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
604
								}
605
							} else {
606
								this.tagValue = TAG_SEE_VALUE;
607
								valid = parseReference();
608
							}
645
							}
609
						} else if (length == TAG_SERIAL_LENGTH && CharOperation.equals(TAG_SERIAL, tagName)) {
646
							if (valid) {
610
							this.tagValue = TAG_SERIAL_VALUE;
647
								this.validValuePositions = (((long) this.tagSourceStart) << 32) + this.tagSourceEnd;
611
							this.tagWaitingForDescription = this.tagValue;
648
								this.invalidValuePositions = -1;
612
						} else if (length == TAG_SERIAL_DATA_LENGTH && CharOperation.equals(TAG_SERIAL_DATA, tagName)) {
613
							this.tagValue = TAG_SERIAL_DATA_VALUE;
614
							this.tagWaitingForDescription = this.tagValue;
615
						} else if (length == TAG_SERIAL_FIELD_LENGTH && CharOperation.equals(TAG_SERIAL_FIELD, tagName)) {
616
							this.tagValue = TAG_SERIAL_FIELD_VALUE;
617
							this.tagWaitingForDescription = this.tagValue;
618
						} else if (length == TAG_SINCE_LENGTH && CharOperation.equals(TAG_SINCE, tagName)) {
619
							this.tagValue = TAG_SINCE_VALUE;
620
							this.tagWaitingForDescription = this.tagValue;
621
						}
622
						break;
623
					case 'v':
624
						if (length == TAG_VALUE_LENGTH && CharOperation.equals(TAG_VALUE, tagName)) {
625
							this.tagValue = TAG_VALUE_VALUE;
626
							if (this.sourceLevel >= ClassFileConstants.JDK1_5) {
627
								if (this.inlineTagStarted) {
628
									valid = parseReference();
629
								} else {
630
									valid = false;
631
									if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
632
								}
633
							} else {
649
							} else {
634
								if (this.validValuePositions == -1) {
650
								this.invalidValuePositions = (((long) this.tagSourceStart) << 32) + this.tagSourceEnd;
635
									if (this.invalidValuePositions != -1) {
636
										if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag((int) (this.invalidValuePositions>>>32), (int) this.invalidValuePositions);
637
									}
638
									if (valid) {
639
										this.validValuePositions = (((long) this.tagSourceStart) << 32) + this.tagSourceEnd;
640
										this.invalidValuePositions = -1;
641
									} else {
642
										this.invalidValuePositions = (((long) this.tagSourceStart) << 32) + this.tagSourceEnd;
643
									}
644
								} else {
645
									if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
646
								}
647
							}
651
							}
648
						} else if (length == TAG_VERSION_LENGTH && CharOperation.equals(TAG_VERSION, tagName)) {
649
							this.tagValue = TAG_VERSION_VALUE;
650
							this.tagWaitingForDescription = this.tagValue;
651
						} else {
652
						} else {
652
							createTag();
653
							if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd);
653
						}
654
						}
654
						break;
655
					}
655
					default:
656
				} else if (length == TAG_VERSION_LENGTH && CharOperation.equals(TAG_VERSION, tagName, 0, length)) {
656
						createTag();
657
					this.tagValue = TAG_VERSION_VALUE;
657
						break;
658
					this.tagWaitingForDescription = this.tagValue;
659
				} else {
660
					createTag();
658
				}
661
				}
659
				break;
662
				break;
660
			case TerminalTokens.TokenNamereturn :
663
			default:
661
				this.tagValue = TAG_RETURN_VALUE;
664
				createTag();
662
				valid = parseReturn();
663
				break;
664
			case TerminalTokens.TokenNamethrows :
665
				this.tagValue = TAG_THROWS_VALUE;
666
				valid = parseThrows();
667
				break;
665
				break;
668
		}
666
		}
669
		this.textStart = this.index;
667
		this.textStart = this.index;
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocBugsTest.java (-19 / +8 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 2098-2105 Link Here
2098
}
2098
}
2099
2099
2100
/**
2100
/**
2101
 * Bug 65253: [Javadoc] @@tag is wrongly parsed as @tag
2101
 * @bug 65253: [Javadoc] @@tag is wrongly parsed as @tag
2102
 * @see <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=65253">65253</a>
2102
 * @test Verify that @@return is not interpreted as a return tag<br>
2103
 * 	Note that since fix for bug 237742, the '@' in a tag name does no longer
2104
 * 	flag it as invalid...
2105
 * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=65253"
2106
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=237742"
2103
 */
2107
 */
2104
public void testBug65253() {
2108
public void testBug65253() {
2105
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
2109
	this.reportMissingJavadocTags = CompilerOptions.ERROR;
Lines 2122-2143 Link Here
2122
				"}\n"
2126
				"}\n"
2123
		},
2127
		},
2124
		"----------\n" +
2128
		"----------\n" +
2125
		"1. ERROR in Test.java (at line 3)\n" +
2129
		"1. ERROR in Test.java (at line 11)\n" +
2126
		"	* @@@@see Unknown Should not complain on ref\n" +
2127
		"	   ^^^^^^\n" +
2128
		"Javadoc: Invalid tag\n" +
2129
		"----------\n" +
2130
		"2. ERROR in Test.java (at line 8)\n" +
2131
		"	* @@@param xxx Should not complain on param\n" +
2132
		"	   ^^^^^^^\n" +
2133
		"Javadoc: Invalid tag\n" +
2134
		"----------\n" +
2135
		"3. ERROR in Test.java (at line 9)\n" +
2136
		"	* @@return int\n" +
2137
		"	   ^^^^^^^\n" +
2138
		"Javadoc: Invalid tag\n" +
2139
		"----------\n" +
2140
		"4. ERROR in Test.java (at line 11)\n" +
2141
		"	int foo() { // should warn on missing tag for return type\n" +
2130
		"	int foo() { // should warn on missing tag for return type\n" +
2142
		"	^^^\n" +
2131
		"	^^^\n" +
2143
		"Javadoc: Missing tag for return type\n" +
2132
		"Javadoc: Missing tag for return type\n" +

Return to bug 237742