From 5cac654bcfeb6c422127a001e77ef9b8a2828601 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 15 Apr 2024 20:00:44 +0000 Subject: [PATCH] [BUG] Fix missing javadocs error for nested generated types (#13199) Signed-off-by: Andriy Redko (cherry picked from commit 6447dd16c908673e065cd1b074745618e60c5420) Signed-off-by: github-actions[bot] --- .../java/org/opensearch/missingdoclet/MissingDoclet.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc-tools/missing-doclet/src/main/java/org/opensearch/missingdoclet/MissingDoclet.java b/doc-tools/missing-doclet/src/main/java/org/opensearch/missingdoclet/MissingDoclet.java index e1ad55fe4b60b..470ab75b7930c 100644 --- a/doc-tools/missing-doclet/src/main/java/org/opensearch/missingdoclet/MissingDoclet.java +++ b/doc-tools/missing-doclet/src/main/java/org/opensearch/missingdoclet/MissingDoclet.java @@ -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) {