Skip to content

Commit 6447dd1

Browse files
authored
[BUG] Fix missing javadocs error for nested generated types (opensearch-project#13199)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
1 parent 00df37e commit 6447dd1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

doc-tools/missing-doclet/src/main/java/org/opensearch/missingdoclet/MissingDoclet.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,20 @@ private void checkComment(Element element) {
332332

333333
// Ignore classes annotated with @Generated and all enclosed elements in them.
334334
private boolean isGenerated(Element element) {
335-
return element
335+
final boolean isGenerated = element
336336
.getAnnotationMirrors()
337337
.stream()
338338
.anyMatch(m -> m
339339
.getAnnotationType()
340340
.toString() /* ClassSymbol.toString() returns class name */
341341
.equalsIgnoreCase("javax.annotation.Generated"));
342+
343+
if (!isGenerated && element.getEnclosingElement() != null) {
344+
// check if enclosing element is generated
345+
return isGenerated(element.getEnclosingElement());
346+
}
347+
348+
return isGenerated;
342349
}
343350

344351
private boolean hasInheritedJavadocs(Element element) {

0 commit comments

Comments
 (0)