Bug 68017 - Javadoc processing does not detect missing argument to @return
Summary: Javadoc processing does not detect missing argument to @return
Status: RESOLVED 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.1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-21 11:31 EDT by Dani Megert CLA
Modified: 2004-09-06 10:31 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2004-06-21 11:31:43 EDT
3.0 RC3

/**
 * @return
 */
 int get();

It should warn about the missing argument for @return tag if compiler option to
process Javadoc is enabled.
Comment 1 Frederic Fusier CLA 2004-06-21 11:58:49 EDT
There's no expected reference after @return tag. See javadoc tool 1.4 spec
(http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#@return):
@return  description 
    Adds a "Returns" section with the description text. This text should 
    describe the return type and permissible range of values. This tag is valid 
    only in a doc comment for a method.
    For more details, see 
    http://java.sun.com/j2se/javadoc/writingdoccomments/index.html#@return. 
Comment 2 Dani Megert CLA 2004-06-21 12:51:04 EDT
I did not say anything about a reference but there must be a description as you
can read in your comment ;-)

javadoc tool issues a warning if the description is missing. You can find such
warnings in Eclipse SDK's javadoc log.
Comment 3 Frederic Fusier CLA 2004-06-21 12:57:01 EDT
It seems that I've read the spec in diagonal...
But the fact that description was mandatory seemed not really obvious for me.
I read it with your help ;) and now agree that we *should* have a non-empty
description here...
Comment 4 Frederic Fusier CLA 2004-06-21 12:57:23 EDT
deferred post 3.0
Comment 5 Frederic Fusier CLA 2004-07-05 09:01:46 EDT
Candidate for 3.0.1
Comment 6 Frederic Fusier CLA 2004-07-08 09:40:36 EDT
Fixed.

In this case, compiler now reports following warning:
"Javadoc: Missing return type description"

[jdt-core-internal]
Change done in AbstractCommentParser.parseComment(int,int).
Also add methods verifyCharsAfterReturnTag(int).
Test cases added in JavadocTestMixed and ASTConverterJavadocTest.
Comment 7 Frederic Fusier CLA 2004-07-08 09:40:55 EDT
Released in HEAD.
Comment 8 Steven Wasleski CLA 2004-07-20 15:05:33 EDT
Pardon my interjection, but I am a little confused here.  This bug has a 
target milestone of 3.0.1 but the fix has only been released to HEAD.  Will 
this be fixed in 3.0.1?
Comment 9 Frederic Fusier CLA 2004-07-21 06:34:52 EDT
Yes it was. "Fixed" in comment 6 means "Fixed and released in R3_0_maintenance
stream".

I never precise explicitely stream in wich I fix the bug assuming this is always
bug target default stream. For 3.0.1 target this is R3_0_maintenance stream and
for 3.1 this is HEAD stream.

So, you do not need to rely on comments to know whether the bug is fixed for
3.0.1 or not. Look at target and status/resolution: 3.0.1 + RESOLVED/FIXED means
that this bug is fixed for 3.0.1 version...

Comment 7 was only to signal that the bug was also fixed for 3.1 version.
Comment 10 Steven Wasleski CLA 2004-07-21 11:37:42 EDT
Sorry, I missed that as I read the bug.  Many others had been explicitly 
posting "released to maintenance stream" comments.  As you point out that 
comment is not really required since the fields indicate it, but I had grown 
accustom to the message.
Comment 11 Markus Keller CLA 2004-08-25 05:08:15 EDT
This warning is rather inconsistent in I200408241200:
(1)  There's only a warning when the @return tag is the last tag in the javadoc.
(2)  There's no warning for missing descriptions for @param, @exception, etc. .
I would expect to get warnings everywhere or nowhere, but not only for some tags.

This example produces no warning at all:
	/**
	 * @param param
	 * @return
	 * @throws IOException
	 */
	public int m(int param) throws IOException {
		throw new IOException(Integer.toString(param));
	}
Comment 12 David Audel CLA 2004-09-06 10:31:33 EDT
Verified for 3.0.1 RC1