Skip to content

fix: stop javadoc from reporting the imported tree's missing comments - #45

Merged
marevol merged 1 commit into
mainfrom
fix/javadoc-doclint
Sep 14, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/javadoc-doclint

Conversation

@marevol

@marevol marevol commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #44. That one cleared the javadoc errors; this clears the noise
left behind.

What was still being reported

12,486 warnings, every one of them from doclint's missing group:

count finding
6,744 no comment
2,332 no @return
315 no @throws for java.io.IOException
216 no main description
212 default constructor without a comment
2,667 @param gaps (request, in, <T>, name, …)

All of it is the imported OpenSearch tree's own documentation coverage. Nothing
here is going to fill it in, and at that volume it hides anything that would
actually be worth reading — [WARNING] Javadoc Warnings was the only line the
build printed about a twelve-thousand-entry list.

Change

<doclint>all,-missing</doclint>

The groups that catch real breakage — syntax, html, accessibility,
reference — keep failing the build, so a malformed comment or a link to something
that was pruned is still caught the way #44's 201 broken references were. Only
completeness is switched off.

It also removes a JDK dependency: missing is the group whose reporting varies
most between JDK versions, so pinning it makes the outcome the same wherever the
build runs.

Verification

mvn javadoc:javadoc BUILD SUCCESS — 0 errors, 0 warnings
mvn -Prelease javadoc:jar BUILD SUCCESS — 0 errors, 0 warnings
generated pages 4,902 — unchanged

Checked against a fresh clone of main as well, to be sure the result is not an
artefact of a local working tree.

#44 removed the javadoc errors but left 12,486 warnings, all of them from
doclint's `missing` group: 6,744 "no comment", 2,332 "no @return", and
@param/@throws gaps throughout the imported OpenSearch tree. That is upstream's
documentation coverage, not a defect introduced here, and it buries anything worth
reading in the build output.

Set `doclint` to `all,-missing`, so the groups that catch real breakage - syntax,
HTML, accessibility and references - still fail the build, while completeness is
left alone. It also pins behaviour that otherwise depends on the JDK in use.

`mvn javadoc:javadoc` and `mvn -Prelease javadoc:jar` now report 0 errors and
0 warnings, and still generate all 4,902 pages.
@marevol marevol self-assigned this Sep 14, 2026
@marevol
marevol merged commit fc73fc1 into main Sep 14, 2026
1 check passed
marevol added a commit that referenced this pull request Sep 14, 2026
#45 silenced doclint's `missing` group because the imported OpenSearch tree
carried 12,486 warnings. That hid the finding rather than fixing it, and left the
one javadoc group that says whether an API is usable turned off for the whole
repository, our own code included.

The tree is documented now and the override is gone, so `doclint` runs at full
strength again.

Every edit was placed at the file, line and column javadoc itself reported, and
the run was repeated until it reported nothing:

- 6,747 doc comments written for undocumented members
- 7,682 `@param`, 5,027 `@return` and 1,245 `@throws` tags
- 218 main descriptions for comments that began with a tag
- 212 implicit constructors declared, each with the access the compiler already
  gave it, because a default constructor has nowhere to carry a comment

Prose comes from the declaration: `getIndices()` is "Returns the indices.",
`writeTo` is "Writes this instance to the given output.", `IOException` is "if an
I/O error occurs". Existing comment text is never rewritten - tags are inserted
into the block in conventional order, and the only lines removed are single-line
comments expanded to three, plus one `{}` split so a constructor could go in.

Placement needed care in four ways that a naive pass gets wrong: a doc comment
under an annotation is not a doc comment, `no main description` points inside the
comment rather than at the declaration, a trailing `// note` stops a line looking
finished, and enum constants each need their own anchor.

`mvn javadoc:javadoc` and `mvn -Prelease javadoc:jar` report 0 errors and
0 warnings under `-Xdoclint:all`, generating the same 4,902 pages; 636 tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant