Skip to content

Commit

Permalink
[BUG] Fix missing javadocs error for nested generated types (opensear…
Browse files Browse the repository at this point in the history
…ch-project#13199) (opensearch-project#13200)

(cherry picked from commit 6447dd1)

Signed-off-by: Andriy Redko <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 2575937 commit 93d7afb
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 93d7afb

Please sign in to comment.