Bug 54424 - AST has structural problems with incomplete javadoc tags
Summary: AST has structural problems with incomplete javadoc tags
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 51600
Blocks:
  Show dependency tree
 
Reported: 2004-03-11 03:17 EST by Markus Keller CLA
Modified: 2004-05-18 12:04 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 Markus Keller CLA 2004-03-11 03:17:34 EST
I20040309
The Javadoc AST nodes have various problems with incomplete/erroneous javadoc
tags, which causes problems when they have to be modified. Some TagElements are
missing, and some appear inside others where they shouldn't. These findings were
made with the help of the org.eclipse.jdt.astview plugin from
http://www.eclipse.org/jdt/ > UI > Optional Plugins.

...
	/**
	 * @param
	 * @param tho {@link getList(int, long)}
	 * @version throwaway
	 * @param from 1st param of {@link A#getList(int, long, boolean) me}
	 * @see #getList(Object, java.util.ArrayList)
	 * @param from 2nd
	 * @see #getList(int from, tho long)
	 * @see #getList(int from, long tho)
	 * @param 
	 * @return the list
	 * @see #getList(..)
	 * @param to
	 * @throws .IOException
	 * @deprecated
	 * @throws IOException.
	 * @todo it
	 */
	public ArrayList getList(int from, long to) throws IOException {
...

(comment line:)
  (1) @param without name is not recognized as TagElement
  (2) the third fragment of @param tho ... is a TextElement with an invalid
range "int, long)}". It should either be an @link tag or merged with the
previous TextElement
  (3) TextElement fragment of @version includes the leading whitespace. 
  (4) @link has MethodRef with false binding to getList(int, long)
  (5) @see also has false binding to getList(int, long)
  (7) the @see tag after "@param from 2nd" is not recognized as TagElement; the
")" of the @see tag is the third fragment of the previous @param tag. This is
probably because there's no param "long" of type "tho"
  (9) like (1): @param is not a TagElement
 (11) like (7): @see is not a TagElement; previous @return TagElement has second
TextElement with ".)"
 (13) @throws TagElement missing. TextElement "IOException" is 2nd fragment of
previous @param to. The linebreak and "@throws ." are not represented anywhere.
 (15) "@throws IOException." is not a TagElement and is missing from the AST.
Comment 1 Frederic Fusier CLA 2004-03-24 15:48:27 EST
As it was said in bug 51600, javadoc tags which have syntax errors are not 
stored in AST javadoc node hierarchy.

Let this bug as dependent of it instead of return as duplicate to verify that 
each problem (patiently noticed) will be fixed...
Comment 2 Frederic Fusier CLA 2004-05-16 09:49:00 EDT
Note that point 3) is not really a problem: it works "as wanted".
We decided to put in text following tag name even leading white spaces in 
order to have maximum of information in TextElement and avoid text rescan.
For example in following example:
@see Object Who does not Object?
@see Object                 Who does not Object?
@see Object
     Who does not Object?
We do not need to rescan Javadoc text to know that these three tags are 
different and be able to print them exactly as they were written...

So, this will not change for 3.0...

Please open a new bug if you think that this behavior must be changed for some 
tags (@version for example...)
Comment 3 Frederic Fusier CLA 2004-05-16 09:53:43 EDT
Note that point 5) is not a problem: it works "as wanted".
When found reference is not applicable, we store the closest match we've found 
if one exist. Binding will be null only if we get no method at all (and in 
this case , the message will be "The method MMM is undefined...").

This behavior for references in Javadoc is the same than those found in code, 
so we do not plan to change it for 3.0...

If you thing it should, then open a new bug addressing this issue...
Comment 4 Frederic Fusier CLA 2004-05-16 09:57:39 EDT
All other problems were fixed when bug 51600 was fixed.

However, I still do not resolve this bug as duplicate to be sure that all 
these tests are taken into account to validate bug 51600 implementation...
Comment 5 Frederic Fusier CLA 2004-05-16 17:05:30 EDT
Test case added in ASTConverterJavadocTests.
Comment 6 Olivier Thomann CLA 2004-05-18 12:04:02 EDT
Verified in 200405180816