Skip to content

Commit

Permalink
[BUG] Fix missing javadocs error for nested generated types (#13199)
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Redko <[email protected]>
  • Loading branch information
reta authored Apr 15, 2024
1 parent 00df37e commit 6447dd1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,20 @@ private void checkComment(Element element) {

// Ignore classes annotated with @Generated and all enclosed elements in them.
private boolean isGenerated(Element element) {
return element
final boolean isGenerated = element
.getAnnotationMirrors()
.stream()
.anyMatch(m -> m
.getAnnotationType()
.toString() /* ClassSymbol.toString() returns class name */
.equalsIgnoreCase("javax.annotation.Generated"));

if (!isGenerated && element.getEnclosingElement() != null) {
// check if enclosing element is generated
return isGenerated(element.getEnclosingElement());
}

return isGenerated;
}

private boolean hasInheritedJavadocs(Element element) {
Expand Down

0 comments on commit 6447dd1

Please sign in to comment.