Community
Participate
Working Groups
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.
Asking Core for comments if this is something that the compiler can provide.
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
Option org.eclipse.jdt.core.compiler.problem.missingAnnotation has been added to CompilerOptions API
Verified.
*** Bug 36887 has been marked as a duplicate of this bug. ***