Bug 53290 - [Javadoc] Compiler should complain when tag name is not correct
Summary: [Javadoc] Compiler should complain when tag name is not correct
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 minor (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-27 11:13 EST by Frederic Fusier CLA
Modified: 2004-05-18 11:57 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2004-02-27 11:13:44 EST
Build I20040226.

Compiler does not complain on following invalid syntax in inline tag in Javadoc 
comment:
/**
 * Returns the string that would be inserted at the position returned from 
 * {@see #getCompletionOffset()} if this proposal was applied. If the 
 * replacement string cannot be determined, <code>null</code> may be returned.
 * 
 * @return the replacement string or <code>null</code> if cannot be determined
 */
CharSequence getCompletionText();

DOM/AST Javadoc is built correctly but compiler should warn user that wrote a 
wrong tag name in his javadoc comment.
Comment 1 Frederic Fusier CLA 2004-02-27 11:15:57 EST
Should verify what is Javadoc tool behavior in this case...
Comment 2 Philipe Mulet CLA 2004-02-27 12:30:05 EST
Isn't the @see tag not supposed to be in inline mode, and thus ignore from 
subsequent analysis ? If so, we should rather complain that the @see tag is 
malformed (only check reference once correctly formed).
Comment 3 Frederic Fusier CLA 2004-03-05 11:17:06 EST
If compiler signals a syntax error in this case, then no references will be 
stored for this tag => no check will be performed on this syntax...

Comment 4 Frederic Fusier CLA 2004-03-05 11:17:26 EST
See also bug 53075.
Comment 5 Frederic Fusier CLA 2004-05-11 05:38:22 EDT
Fixed.

Now compiler reports an 'Unexpected tag' error when {@see...} or * @link ...
syntaxes are encountered.
Note that in this case, we consider such tags as extra tags and just store their
name and the text after even if the reference is valid...
For example, this means that <code>* {@see Object}</code> will be only a tag
element which name would be "@see" and has one single text element
' Object'.

[jdt-core-internal]
Changes made in parseComment(int,int) of AbstractCommentParser: in these cases,
only parse simple tag instead of a see tag (ie. using parseSee(boolean) method)
and start text fragment storage to get the rest of the tag.
Test case added in JavadocTestMixed
Comment 6 Olivier Thomann CLA 2004-05-18 11:57:48 EDT
Verified in 200405180816