Merge pull request #16103 from github/dbartol/javadoc-record

Allow `@param` tags to apply to record parameters
This commit is contained in:
Dave Bartolomeo
2024-04-09 14:21:45 -04:00
committed by GitHub
5 changed files with 34 additions and 1 deletions

View File

@@ -32,12 +32,24 @@ where
)
or
documentable instanceof ClassOrInterface and
not documentable instanceof Record and
not exists(TypeVariable tv | tv.getGenericType() = documentable |
"<" + tv.getName() + ">" = paramTag.getParamName()
) and
msg =
"@param tag \"" + paramTag.getParamName() +
"\" does not match any actual type parameter of type \"" + documentable.getName() + "\"."
or
documentable instanceof Record and
not exists(TypeVariable tv | tv.getGenericType() = documentable |
"<" + tv.getName() + ">" = paramTag.getParamName()
) and
not documentable.(Record).getCanonicalConstructor().getAParameter().getName() =
paramTag.getParamName() and
msg =
"@param tag \"" + paramTag.getParamName() +
"\" does not match any actual type parameter or record parameter of record \"" +
documentable.getName() + "\"."
else
// The tag has no value at all.
msg = "This @param tag does not have a value."

View File

@@ -0,0 +1,5 @@
---
category: minorAnalysis
---
* The `java/unknown-javadoc-parameter` now accepts `@param` tags that apply to the parameters of a
record.