Bug 51660 - [DOM/AST] AST.parse* should handle all legal doc tags
Summary: [DOM/AST] AST.parse* should handle all legal doc tags
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-11 11:26 EST by Jim des Rivieres CLA
Modified: 2004-05-28 14:50 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim des Rivieres CLA 2004-02-11 11:26:59 EST
The characters allowed in the tag name of a doc tag are more general than just 
a Java identifier. In particular, I came across J2EE examples recently of doc 
tags like

   @ejb.bean-interface-method prop1="x", prop2="y"

We should investigate what Javadoc considers as the set of legal characters in 
a doc tag name, and make sure that AST.parse* handles these properly.
Comment 1 Frederic Fusier CLA 2004-02-13 05:18:42 EST
The original spec was the Javadoc from Sun: 
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html
which says:
"...
JAVADOC TAGS
The Javadoc tool parses special tags when they are embedded within a Java doc 
comment. These doc tags enable you to autogenerate a complete, well-formatted 
API from your source code. The tags start with an "at" sign (@) and are case-
sensitive -- they must be typed with the uppercase and lowercase letters as 
shown. A tag must start at the beginning of a line (after any leading spaces 
and an optional asterisk) or it is treated as normal text. By convention, tags 
with the same name are grouped together. For example, put all @see tags 
together.   
..."
Comment 2 Philipe Mulet CLA 2004-05-24 12:52:57 EDT
Consider for RC1 iff javadoc tool supports it. If not, defer post 3.0.
Comment 3 Frederic Fusier CLA 2004-05-24 14:45:49 EDT
In fact Javadoc tool raises warnings for all unknown tags (ie. all tags which
are not listed in spec - see
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#javadoctags).
To avoid them, it is possible to specify -tag option which let Javadoc tool to
accept custom tags...

However, Javadoc tool does not accept custom tag when it includes one of the
following character:
!, ", #, %, &, ', -, :, <, >

So, that means that we should accept all tag names with non-java identifiers
character which are not invalid for Javadoc tool.

This also means that the example provided by Jeem will be rejected as it
contains the invalid character '-'...
Comment 4 Frederic Fusier CLA 2004-05-25 07:08:56 EDT
Fixed.

Accept now tag name with non-java identifier characters but valid for Javadoc 
tool. That means that following sample tags are now accepted:
/**
 * @ejb(bean text...
 * @ejb)bean text...
 * @ejb*bean text...
 * @ejb+bean text...
 * @ejb,bean text...
 * @ejb.bean text...
 * @ejb/bean text...
 * @ejb;bean text...
 * @ejb=bean text...
 * @ejb?bean text...
 * @ejb[bean text...
 * @ejb]bean text...
 * @ejb^bean text...
 * @ejb{bean text...
 * @ejb|bean text...
 * @ejb~bean text...
 */

[jtd-core-internal]
Change done in AbstractCommentParser.parseComment(int,int).
Test case added in ASTConverterJavadocTests

Comment 5 Frederic Fusier CLA 2004-05-25 13:50:31 EDT
Finally, we also accept characters which are scanned as token error by scanner.
This allow following additional valid tags:
/**
 * @ejb¦bean test non-java id character '¦' (val=166) in tag name
 * @ejb§bean test non-java id character '§' (val=167) in tag name
 * @ejb¨bean test non-java id character '¨' (val=168) in tag name
 * @ejb©bean test non-java id character '©' (val=169) in tag name
 * @ejb«bean test non-java id character '«' (val=171) in tag name
 * @ejb¬bean test non-java id character '¬' (val=172) in tag name
 * @ejb®bean test non-java id character '®' (val=174) in tag name
 * @ejb¯bean test non-java id character '¯' (val=175) in tag name
 * @ejb°bean test non-java id character '°' (val=176) in tag name
 * @ejb±bean test non-java id character '±' (val=177) in tag name
 * @ejb²bean test non-java id character '²' (val=178) in tag name
 * @ejb³bean test non-java id character '³' (val=179) in tag name
 * @ejb´bean test non-java id character '´' (val=180) in tag name
 * @ejb¶bean test non-java id character '¶' (val=182) in tag name
 * @ejb·bean test non-java id character '·' (val=183) in tag name
 * @ejb¸bean test non-java id character '¸' (val=184) in tag name
 * @ejb¹bean test non-java id character '¹' (val=185) in tag name
 * @ejb»bean test non-java id character '»' (val=187) in tag name
 * @ejb¼bean test non-java id character '¼' (val=188) in tag name
 * @ejb½bean test non-java id character '½' (val=189) in tag name
 * @ejb¾bean test non-java id character '¾' (val=190) in tag name
 * @ejb¿bean test non-java id character '¿' (val=191) in tag name
 * @ejb×bean test non-java id character '×' (val=215) in tag name
 * @ejb÷bean test non-java id character '÷' (val=247) in tag name
 */
Comment 6 Olivier Thomann CLA 2004-05-28 14:50:58 EDT
Verified in 200405281200