Lines 508-529
Link Here
|
508 |
boolean valid = false; |
508 |
boolean valid = false; |
509 |
switch (firstChar) { |
509 |
switch (firstChar) { |
510 |
case 'a': |
510 |
case 'a': |
511 |
if (!this.inlineTagStarted && length == TAG_AUTHOR_LENGTH && CharOperation.equals(TAG_AUTHOR, tagName, 0, length)) { |
511 |
if (length == TAG_AUTHOR_LENGTH && CharOperation.equals(TAG_AUTHOR, tagName, 0, length)) { |
512 |
this.tagValue = TAG_AUTHOR_VALUE; |
512 |
this.tagValue = TAG_AUTHOR_VALUE; |
513 |
this.tagWaitingForDescription = this.tagValue; |
513 |
this.tagWaitingForDescription = this.tagValue; |
514 |
} |
514 |
} |
515 |
break; |
515 |
break; |
516 |
case 'c': |
516 |
case 'c': |
517 |
if (!this.inlineTagStarted && length == TAG_CATEGORY_LENGTH && CharOperation.equals(TAG_CATEGORY, tagName, 0, length)) { |
517 |
if (length == TAG_CATEGORY_LENGTH && CharOperation.equals(TAG_CATEGORY, tagName, 0, length)) { |
518 |
this.tagValue = TAG_CATEGORY_VALUE; |
518 |
this.tagValue = TAG_CATEGORY_VALUE; |
519 |
valid = parseIdentifierTag(false); // TODO (frederic) reconsider parameter value when @category will be significant in spec |
519 |
if (!this.inlineTagStarted) { |
|
|
520 |
valid = parseIdentifierTag(false); // TODO (frederic) reconsider parameter value when @category will be significant in spec |
521 |
} |
520 |
} else if (length == TAG_CODE_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_CODE, tagName, 0, length)) { |
522 |
} else if (length == TAG_CODE_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_CODE, tagName, 0, length)) { |
521 |
this.tagValue = TAG_CODE_VALUE; |
523 |
this.tagValue = TAG_CODE_VALUE; |
522 |
this.tagWaitingForDescription = this.tagValue; |
524 |
this.tagWaitingForDescription = this.tagValue; |
523 |
} |
525 |
} |
524 |
break; |
526 |
break; |
525 |
case 'd': |
527 |
case 'd': |
526 |
if (!this.inlineTagStarted && length == TAG_DEPRECATED_LENGTH && CharOperation.equals(TAG_DEPRECATED, tagName, 0, length)) { |
528 |
if (length == TAG_DEPRECATED_LENGTH && CharOperation.equals(TAG_DEPRECATED, tagName, 0, length)) { |
527 |
this.deprecated = true; |
529 |
this.deprecated = true; |
528 |
valid = true; |
530 |
valid = true; |
529 |
this.tagValue = TAG_DEPRECATED_VALUE; |
531 |
this.tagValue = TAG_DEPRECATED_VALUE; |
Lines 536-544
Link Here
|
536 |
} |
538 |
} |
537 |
break; |
539 |
break; |
538 |
case 'e': |
540 |
case 'e': |
539 |
if (!this.inlineTagStarted && length == TAG_EXCEPTION_LENGTH && CharOperation.equals(TAG_EXCEPTION, tagName, 0, length)) { |
541 |
if (length == TAG_EXCEPTION_LENGTH && CharOperation.equals(TAG_EXCEPTION, tagName, 0, length)) { |
540 |
this.tagValue = TAG_EXCEPTION_VALUE; |
542 |
this.tagValue = TAG_EXCEPTION_VALUE; |
541 |
valid = parseThrows(); |
543 |
if (!this.inlineTagStarted) { |
|
|
544 |
valid = parseThrows(); |
545 |
} |
542 |
} |
546 |
} |
543 |
break; |
547 |
break; |
544 |
case 'i': |
548 |
case 'i': |
Lines 571-635
Link Here
|
571 |
this.tagValue = TAG_LINK_VALUE; |
575 |
this.tagValue = TAG_LINK_VALUE; |
572 |
if (this.inlineTagStarted || (this.kind & COMPLETION_PARSER) != 0) { |
576 |
if (this.inlineTagStarted || (this.kind & COMPLETION_PARSER) != 0) { |
573 |
valid= parseReference(); |
577 |
valid= parseReference(); |
574 |
} else { |
|
|
575 |
// bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=53290 |
576 |
// Cannot have @link outside inline comment |
577 |
valid = false; |
578 |
if (this.reportProblems) { |
579 |
this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd); |
580 |
} |
581 |
} |
578 |
} |
582 |
} else if (length == TAG_LINKPLAIN_LENGTH && CharOperation.equals(TAG_LINKPLAIN, tagName, 0, length)) { |
579 |
} else if (length == TAG_LINKPLAIN_LENGTH && CharOperation.equals(TAG_LINKPLAIN, tagName, 0, length)) { |
583 |
this.tagValue = TAG_LINKPLAIN_VALUE; |
580 |
this.tagValue = TAG_LINKPLAIN_VALUE; |
584 |
if (this.inlineTagStarted) { |
581 |
if (this.inlineTagStarted) { |
585 |
valid = parseReference(); |
582 |
valid = parseReference(); |
586 |
} else { |
583 |
} |
587 |
valid = false; |
|
|
588 |
if (this.reportProblems) { |
589 |
this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd); |
590 |
} |
591 |
} |
592 |
} else if (length == TAG_LITERAL_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_LITERAL, tagName, 0, length)) { |
584 |
} else if (length == TAG_LITERAL_LENGTH && this.inlineTagStarted && CharOperation.equals(TAG_LITERAL, tagName, 0, length)) { |
593 |
this.tagValue = TAG_LITERAL_VALUE; |
585 |
this.tagValue = TAG_LITERAL_VALUE; |
594 |
this.tagWaitingForDescription = this.tagValue; |
586 |
this.tagWaitingForDescription = this.tagValue; |
595 |
} |
587 |
} |
596 |
break; |
588 |
break; |
597 |
case 'p': |
589 |
case 'p': |
598 |
if (!this.inlineTagStarted && length == TAG_PARAM_LENGTH && CharOperation.equals(TAG_PARAM, tagName, 0, length)) { |
590 |
if (length == TAG_PARAM_LENGTH && CharOperation.equals(TAG_PARAM, tagName, 0, length)) { |
599 |
this.tagValue = TAG_PARAM_VALUE; |
591 |
this.tagValue = TAG_PARAM_VALUE; |
600 |
valid = parseParam(); |
592 |
if (!this.inlineTagStarted) { |
|
|
593 |
valid = parseParam(); |
594 |
} |
601 |
} |
595 |
} |
602 |
break; |
596 |
break; |
603 |
case 'r': |
597 |
case 'r': |
604 |
if (!this.inlineTagStarted && length == TAG_RETURN_LENGTH && CharOperation.equals(TAG_RETURN, tagName, 0, length)) { |
598 |
if (length == TAG_RETURN_LENGTH && CharOperation.equals(TAG_RETURN, tagName, 0, length)) { |
605 |
this.tagValue = TAG_RETURN_VALUE; |
599 |
this.tagValue = TAG_RETURN_VALUE; |
606 |
valid = parseReturn(); |
600 |
if (!this.inlineTagStarted) { |
|
|
601 |
valid = parseReturn(); |
602 |
} |
607 |
} |
603 |
} |
608 |
break; |
604 |
break; |
609 |
case 's': |
605 |
case 's': |
610 |
if (!this.inlineTagStarted) { |
606 |
if (length == TAG_SEE_LENGTH && CharOperation.equals(TAG_SEE, tagName, 0, length)) { |
611 |
if (length == TAG_SEE_LENGTH && CharOperation.equals(TAG_SEE, tagName, 0, length)) { |
607 |
this.tagValue = TAG_SEE_VALUE; |
612 |
this.tagValue = TAG_SEE_VALUE; |
608 |
if (!this.inlineTagStarted) { |
613 |
valid = parseReference(); |
609 |
valid = parseReference(); |
614 |
} else if (length == TAG_SERIAL_LENGTH && CharOperation.equals(TAG_SERIAL, tagName, 0, length)) { |
610 |
} |
615 |
this.tagValue = TAG_SERIAL_VALUE; |
611 |
} else if (length == TAG_SERIAL_LENGTH && CharOperation.equals(TAG_SERIAL, tagName, 0, length)) { |
616 |
this.tagWaitingForDescription = this.tagValue; |
612 |
this.tagValue = TAG_SERIAL_VALUE; |
617 |
} else if (length == TAG_SERIAL_DATA_LENGTH && CharOperation.equals(TAG_SERIAL_DATA, tagName, 0, length)) { |
613 |
this.tagWaitingForDescription = this.tagValue; |
618 |
this.tagValue = TAG_SERIAL_DATA_VALUE; |
614 |
} else if (length == TAG_SERIAL_DATA_LENGTH && CharOperation.equals(TAG_SERIAL_DATA, tagName, 0, length)) { |
619 |
this.tagWaitingForDescription = this.tagValue; |
615 |
this.tagValue = TAG_SERIAL_DATA_VALUE; |
620 |
} else if (length == TAG_SERIAL_FIELD_LENGTH && CharOperation.equals(TAG_SERIAL_FIELD, tagName, 0, length)) { |
616 |
this.tagWaitingForDescription = this.tagValue; |
621 |
this.tagValue = TAG_SERIAL_FIELD_VALUE; |
617 |
} else if (length == TAG_SERIAL_FIELD_LENGTH && CharOperation.equals(TAG_SERIAL_FIELD, tagName, 0, length)) { |
622 |
this.tagWaitingForDescription = this.tagValue; |
618 |
this.tagValue = TAG_SERIAL_FIELD_VALUE; |
623 |
} else if (length == TAG_SINCE_LENGTH && CharOperation.equals(TAG_SINCE, tagName, 0, length)) { |
619 |
this.tagWaitingForDescription = this.tagValue; |
624 |
this.tagValue = TAG_SINCE_VALUE; |
620 |
} else if (length == TAG_SINCE_LENGTH && CharOperation.equals(TAG_SINCE, tagName, 0, length)) { |
625 |
this.tagWaitingForDescription = this.tagValue; |
621 |
this.tagValue = TAG_SINCE_VALUE; |
626 |
} |
622 |
this.tagWaitingForDescription = this.tagValue; |
627 |
} |
623 |
} |
628 |
break; |
624 |
break; |
629 |
case 't': |
625 |
case 't': |
630 |
if (!this.inlineTagStarted && length == TAG_THROWS_LENGTH && CharOperation.equals(TAG_THROWS, tagName, 0, length)) { |
626 |
if (length == TAG_THROWS_LENGTH && CharOperation.equals(TAG_THROWS, tagName, 0, length)) { |
631 |
this.tagValue = TAG_THROWS_VALUE; |
627 |
this.tagValue = TAG_THROWS_VALUE; |
632 |
valid = parseThrows(); |
628 |
if (!this.inlineTagStarted) { |
|
|
629 |
valid = parseThrows(); |
630 |
} |
633 |
} |
631 |
} |
634 |
break; |
632 |
break; |
635 |
case 'v': |
633 |
case 'v': |
Lines 638-646
Link Here
|
638 |
if (this.sourceLevel >= ClassFileConstants.JDK1_5) { |
636 |
if (this.sourceLevel >= ClassFileConstants.JDK1_5) { |
639 |
if (this.inlineTagStarted) { |
637 |
if (this.inlineTagStarted) { |
640 |
valid = parseReference(); |
638 |
valid = parseReference(); |
641 |
} else { |
|
|
642 |
valid = false; |
643 |
if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd); |
644 |
} |
639 |
} |
645 |
} else { |
640 |
} else { |
646 |
if (this.validValuePositions == -1) { |
641 |
if (this.validValuePositions == -1) { |
Lines 657-663
Link Here
|
657 |
if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd); |
652 |
if (this.reportProblems) this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd); |
658 |
} |
653 |
} |
659 |
} |
654 |
} |
660 |
} else if (!this.inlineTagStarted && length == TAG_VERSION_LENGTH && CharOperation.equals(TAG_VERSION, tagName, 0, length)) { |
655 |
} else if (length == TAG_VERSION_LENGTH && CharOperation.equals(TAG_VERSION, tagName, 0, length)) { |
661 |
this.tagValue = TAG_VERSION_VALUE; |
656 |
this.tagValue = TAG_VERSION_VALUE; |
662 |
this.tagWaitingForDescription = this.tagValue; |
657 |
this.tagWaitingForDescription = this.tagValue; |
663 |
} else { |
658 |
} else { |
Lines 669-680
Link Here
|
669 |
break; |
664 |
break; |
670 |
} |
665 |
} |
671 |
this.textStart = this.index; |
666 |
this.textStart = this.index; |
672 |
if (this.tagValue != TAG_OTHERS_VALUE && !this.inlineTagStarted) { |
667 |
if (this.tagValue != TAG_OTHERS_VALUE) { |
673 |
this.lastBlockTagValue = this.tagValue; |
668 |
if (!this.inlineTagStarted) { |
674 |
} |
669 |
this.lastBlockTagValue = this.tagValue; |
675 |
if (this.inlineTagStarted && this.reportProblems |
670 |
} |
676 |
&& (this.tagValue >= JAVADOC_TAG_TYPE.length || JAVADOC_TAG_TYPE[this.tagValue] != TAG_TYPE_INLINE)) { |
671 |
// bug 267833:[javadoc] Custom tags should not be allowed for inline tags |
677 |
this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd); |
672 |
// Report a problem if a block tag is being used in the context of an inline tag and vice versa. |
|
|
673 |
if ((this.inlineTagStarted && JAVADOC_TAG_TYPE[this.tagValue] == TAG_TYPE_BLOCK) |
674 |
|| (!this.inlineTagStarted && JAVADOC_TAG_TYPE[this.tagValue] == TAG_TYPE_INLINE)) { |
675 |
valid = false; |
676 |
this.tagValue = TAG_OTHERS_VALUE; |
677 |
this.tagWaitingForDescription = NO_TAG_VALUE; |
678 |
if (this.reportProblems) { |
679 |
this.sourceParser.problemReporter().javadocUnexpectedTag(this.tagSourceStart, this.tagSourceEnd); |
680 |
} |
681 |
} |
678 |
} |
682 |
} |
679 |
return valid; |
683 |
return valid; |
680 |
} |
684 |
} |