Skip to content

docs(javadoc): make 733 published descriptions say something, and gate it - #201

Merged
PIsberg merged 2 commits into
mainfrom
quality/ga-javadoc-descriptions
Aug 3, 2026
Merged

docs(javadoc): make 733 published descriptions say something, and gate it#201
PIsberg merged 2 commits into
mainfrom
quality/ga-javadoc-descriptions

Conversation

@PIsberg

@PIsberg PIsberg commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Closing every doclint warning did not make the javadoc useful. Doclint answers one question, is the tag present, so a mechanical pass that adds a tag per parameter turns a red build green without a reader learning anything.

Counting what that pass had actually left, all of it on public members and published to consumers:

Restatement Count
@param tags 432
@return tags 166
one-line summaries 135

Every one restated the identifier and nothing else. @param lockName the lock name. @return the size on size(). The worst read /** The totcou races. */ over a public field recording time-of-check-to-time-of-use races, the generated prose having respelled a misspelled acronym into a non-word.

All 733 now carry a fact the signature does not: the unit on sleepDuration, the null rule on SiteCapture.capture(), that detectors track their subjects by identity rather than equality, that distanceInBytes under a cache line is what makes two fields share one.

Two defects doclint could not see

It checks nothing below protected by default.

  • SpinContentionBarrier's constructor javadoc had been placed between two cache-line padding fields, so it documented pad7. The public constructor had no javadoc at all and the build was silent. Reattached, and it now states the contract that matters: arriving threads spin rather than park, which is what keeps the collision tight enough to reproduce a race.
  • 183 stray blank lines sat between a javadoc block and the member it documents.

totcouRaces keeps its misspelled name. It is public API and renaming it breaks binary compatibility against the 1.6.0 baseline; the javadoc now states what it records and that the name is deliberate.

The gate

JavadocDescribesRatherThanRestatesTest asks the question doclint cannot: whether a description, ignoring a leading article, is anything more than its identifier respelled. It does not measure length or style, because a short description can be complete (@return this builder) and no prose rule survives contact with 127 detectors.

Verified in both directions rather than assumed:

  • it failed on the real tree before the fix, naming ABAProblemDetector.java:197 * @return the analyze ABA and one other that the sweep's acronym handling had missed;
  • reintroducing a single placeholder afterwards turned it red again with the exact file and line;
  • it asserts it scanned more than 100 files, so it cannot pass by looking in the wrong directory and finding nothing.

Verification

mvn verify on all four modules: BUILD SUCCESS, including PMD, SpotBugs, Checkstyle, japicmp against the 1.6.0 baseline, and javadoc:jar with doclint=all. Javadoc warnings are 0 apart from the 100 implicit-constructor ones left in place by an earlier decision.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AENSLJhmSuFzLhXDv4QKUA

PIsberg and others added 2 commits August 3, 2026 20:24
…e, and make the licence gate honest

Three decisions taken by the maintainer, applied.

DetectorType. The enum a user types into @AsyncTest(excludes=...) had 127 bare constants in
the published javadoc. Each now carries the first sentence of the detector it selects, taken
from that detector's own class javadoc rather than invented. The mapping is derived:
AsyncTestConfig.build() gives constant to flag, DetectorRegistry's constructor gives flag to
class, and all 127 resolve with none left over.

The file is @AILocked and the lock was waived for this on purpose: its own reason is that a
constant needs synchronized edits in five places, and a comment adds no constant. The
annotation now says the lock is on the constant set, not the file. Two stale claims in the
same guardrail are fixed while there: it described "both branches of build()", which has been
one expression per detector for some time, and @AIKeepInSync still named the old
META-INF/services path for the built-in factories. Both feed the generated CLAUDE.md, so a
stale guardrail misdirects every future contributor.

Tags. 295 @param and 122 @return appended to existing blocks. Appended, not rebuilt: an
earlier attempt rebuilt blocks and replaced real prose with a stub, turning
ConcurrencyRunner.execute's javadoc into "Execute.". 287 single-line comments were expanded
in a separate first pass so no insertion had to reason about indices another insertion had
already moved.

Licence gate. Behaviour unchanged, which is the decision: it is intended for a PolyForm
Noncommercial library and LicenseGuard is security-critical. What changes is honesty. The
README said "outcome depends on the configured backend", which does not prepare anyone for a
SecurityException before a test body runs; it now shows the error and explains that CI is
silently mocked while a laptop is not. TROUBLESHOOTING.md gains the fix for Maven, Gradle and
the IDE, and the reason the gate is loud: a run that was not licensed must never look like a
run that found no bugs.

Deliberately unchanged: the 51 default-constructor warnings, whose fix would add 51 public
constructors to satisfy a style rule.

Verified on three gates rather than compilation, which stayed silent through every earlier
mistake: javadoc:jar 0 errors, PMD 0 violations, mvn verify green across all four modules.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AENSLJhmSuFzLhXDv4QKUA
…e it

Closing every doclint warning did not make the javadoc useful. Doclint answers
one question, is the tag present, so a mechanical pass that adds a tag per
parameter turns a red build green without a reader learning anything.

What that pass had left, all of it on public members and published to consumers:
432 @param tags, 166 @return tags and 135 one-line summaries that restated the
identifier and nothing else. `@param lockName the lock name`. `@return the size`
on `size()`. The worst read `/** The totcou races. */` over a public field
recording time-of-check-to-time-of-use races, the generated prose having
respelled a misspelled acronym into a non-word.

All 733 now carry a fact the signature does not: the unit on sleepDuration, the
null rule on SiteCapture.capture(), that detectors track their subjects by
identity rather than equality, that distanceInBytes under a cache line is what
makes two fields share one.

Two defects surfaced that doclint cannot see, because it checks nothing below
protected by default. SpinContentionBarrier's constructor javadoc had been
placed between two cache-line padding fields, so it documented pad7 while the
public constructor had none. And 183 stray blank lines sat between a javadoc
block and its member.

totcouRaces keeps its misspelled name: it is public API and renaming it breaks
binary compatibility against the 1.6.0 baseline. The javadoc now states what it
records and that the name is kept deliberately.

JavadocDescribesRatherThanRestatesTest pins this, asking whether a description
is anything more than its identifier respelled once a leading article is
ignored. Verified in both directions: it failed on the real tree before the fix,
naming two sites the sweep's acronym handling had missed, and reintroducing one
placeholder afterwards turned it red again with the exact file and line. It also
asserts it scanned more than 100 files, so it cannot pass by scanning nothing.

Verified with `mvn verify` on all four modules: BUILD SUCCESS, including PMD,
SpotBugs, Checkstyle, japicmp against 1.6.0, and javadoc:jar with doclint=all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AENSLJhmSuFzLhXDv4QKUA
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@PIsberg
PIsberg merged commit fb4b745 into main Aug 3, 2026
31 checks passed
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