Bug 38091 - DCR - Generate warnings for JavaDoc missing entries
Summary: DCR - Generate warnings for JavaDoc missing entries
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 36887 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-25 09:50 EDT by Alex Blewitt CLA
Modified: 2004-03-25 06:24 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 Alex Blewitt CLA 2003-05-25 09:50:27 EDT
I'd like to see a warning if I had a JavaDoc'd piece of code as follows:

/**
 * A description
 * @param first the first parameter
 */
public void method(Object first, Object second) {
}

-> Warning: @param 'second' missing from JavaDoc

Equally, it would be useful if the JavaDoc could also identify spurious doc
comments:
/**
 * A description
 * @param first the first parameter
 * @param second the second parameter
 * @param third the third parameter
 */
public void method(Object first, Object second) {
}
-> Warning: param 'third' missing

You could then be given an auto suggestion to add/delete the missing parameters
(or exception types) as appropriate.

Suitable linitan errors for JavaDoc could also include:
o Missing @version (if desired)
o Missing @author (if desired)
o Malformed HTML in JavaDoc quote
o Missing JavaDoc/non-JavaDoc comment above class/method/field

However, it would probably make sense for these options to be enabled/disabled
so that you don't always have such errors reported.
Comment 1 Dirk Baeumer CLA 2003-05-25 12:36:40 EDT
Asking Core for comments if this is something that the compiler can provide.
Comment 2 Frederic Fusier CLA 2003-10-14 07:26:21 EDT
All kind of javadoc comments can be now validated as soon as
org.eclipse.jdt.core.compiler.problem.invalidAnnotation
is changed to 'warning' or 'error'.

Note that missing annotation can be also verified by setting
org.eclipse.jdt.core.compiler.problem.missingAnnotation
from 'disabled' (default value) to 'enabled'.
This option was not put in the API yet, but will be soon...

New tests cases added in org.eclipse.jdt.core.tests.compiler.regression:
AnnotationTestForClass
AnnotationTestForConstructor
AnnotationTestForField
AnnotationTestForInterface
AnnotationTestForMethod
AnnotationTestMixed
=> 322 additional tests to validate this new functionality
Comment 3 Frederic Fusier CLA 2003-10-15 06:44:03 EDT
Option org.eclipse.jdt.core.compiler.problem.missingAnnotation has been added 
to CompilerOptions API

Comment 4 David Audel CLA 2003-11-19 10:42:46 EST
Verified.
Comment 5 Philipe Mulet CLA 2004-03-25 06:24:25 EST
*** Bug 36887 has been marked as a duplicate of this bug. ***