Bug 170759 - [javadoc] Want javadoc warning for empty tag
Summary: [javadoc] Want javadoc warning for empty tag
Status: RESOLVED DUPLICATE of bug 73352
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eric Jodet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-17 07:30 EST by Johan Walles CLA
Modified: 2007-01-17 10:34 EST (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 Johan Walles CLA 2007-01-17 07:30:02 EST
Build ID: M20060921-0945

Steps To Reproduce:
1. Enable all Javadoc warnings.
2. Write a method that only returns some value.
3. Observe that you get a warning about that there's no javadoc for the method.
4. Auto-create javadoc for that method.  This should give you a javadoc comment with only an empty return tag in it.
5. Note how you don't get any warnings any more, even though you still haven't documented anything.


More information:
Example:
/**
 * @return
 */
int fluff() {
  return 7;
}

I want a warning saying that the @return tag doesn't have any contents.  Or to be more generic, this warning should trigger on any tag that doesn't have any contents.  Possibly only once per javadoc block, saying "Comment has empty javadoc tags."

I want another warning that there's no general description of the method.

The two kinds of warnings should be possible to enable / disable individually.

Right now it's easy to forget to write javadoc since just generating default comments will rid you of all warnings.  I have just taken over a piece of undocumented code where I would have liked to be notified about all empty comments (there are lots...).
Comment 1 Eric Jodet CLA 2007-01-17 09:34:53 EST
I did not manage to recreate the problem.
With the Javadoc warnings enabled, the @return tag is flagged with a warning
(missing return type).

May you please check that the Javadoc warnings are correctly enabled?
May be these settings are overridden at the project level (disabled)
which would cause the @return tag to remain unflagged.
Thanks.
Comment 2 Johan Walles CLA 2007-01-17 09:50:24 EST
Indeed, I should have tried the example before I filed this :-(, the @return tag seems to be treated differently from some other tags.  But my complaint is valid for parameters though:
/**
 * @param hej 
 * @return fluff
 */
int fluff(int hej) {
   return hej + 7;
}

In this example (that I actually tested...) I get no warning that "hej" is undocumented.  Neither do I get any warning that there's no description of what the method is doing (should be before the "@param hej" line).
Comment 3 Eric Jodet CLA 2007-01-17 10:30:44 EST
All these points should be addressed by bug #73552.
Please follow-up this one.

*** This bug has been marked as a duplicate of bug 73552 ***
Comment 4 Eric Jodet CLA 2007-01-17 10:33:36 EST
wrong bug number
Comment 5 Eric Jodet CLA 2007-01-17 10:34:24 EST

*** This bug has been marked as a duplicate of bug 73352 ***