8285496: DocLint does not check for missing @param tags for type parameters on classes and interfaces

Reviewed-by: darcy, iris
This commit is contained in:
Jonathan Gibbons 2022-04-29 00:32:56 +00:00
parent 64d98ba100
commit 8190217971
3 changed files with 9 additions and 3 deletions

View file

@ -251,7 +251,7 @@ public class Checker extends DocTreePathScanner<Void, Void> {
// the following checks are made after the scan, which will record @param tags
if (isDeclaredType()) {
TypeElement te = (TypeElement) env.currElement;
// checkParamsDocumented(te.getTypeParameters()); // See JDK-8285496
checkParamsDocumented(te.getTypeParameters());
checkParamsDocumented(te.getRecordComponents());
} else if (isExecutable()) {
if (!isOverridingMethod) {

View file

@ -1,6 +1,6 @@
/*
* @test /nodynamiccopyright/
* @bug 8004832
* @bug 8004832 8285496
* @summary Add new doclint package
* @modules jdk.javadoc/jdk.javadoc.internal.doclint
* @build DocLintTester
@ -21,4 +21,7 @@ public class MissingParamsTest {
/** . */
<T> void missingTyparam() { }
/** . */
public class MissingTyparam<T> { /** . */ MissingTyparam() { } }
}

View file

@ -10,5 +10,8 @@ MissingParamsTest.java:20: warning: no @param for param
MissingParamsTest.java:23: warning: no @param for <T>
<T> void missingTyparam() { }
^
4 warnings
MissingParamsTest.java:26: warning: no @param for <T>
public class MissingTyparam<T> { /** . */ MissingTyparam() { } }
^
5 warnings