Skip to content

fix(doclet): report a malformed block tag instead of crashing - #14

Merged
Sam Gammon (sgammon) merged 1 commit into
mainfrom
fix/erroneous-block-tag
Nov 27, 2026
Merged

Sam Gammon (sgammon) merged 1 commit into
mainfrom
fix/erroneous-block-tag

Conversation

@sgammon

Copy link
Copy Markdown
Member

Problem

Documenting the GraalVM Truffle API (elide-dev/rules_mx#22) crashed the doclet:

java.lang.NullPointerException
	at java.base/java.util.ImmutableCollections$SetN.contains(ImmutableCollections.java:1183)
	at dev.elide.apidocs.doclet.Comments.parts(Comments.java:369)
	at dev.elide.apidocs.doclet.Extractor.type(Extractor.java:191)

javadoc represents a block tag it cannot parse as an ErroneousTree. Truffle's StaticProperty has @see StaticShape.Builder#property(StaticProperty, Class, boolean)., with a trailing period. That tree's kind has no tag name, so the not-modeled check called Set.of(...).contains(null).

Fix

Report an erroneous block tag as a malformed problem, as erroneous inline content already is. --problems malformed=warning downgrades it.

Testing

  • New ProblemsTest.malformedBlockTagIsAProblem (a bare @throws): an error by default, a warning under malformed=warning. It fails with the NPE without the fix.
  • elide test: 52 pass. elide javaformat --dry-run is clean.
  • With this commit, rules_mx builds the Truffle reference (877 pages).

rules_mx pins this commit until it merges.

javadoc represents a block tag it cannot parse, such as @throws without a type, as an
ErroneousTree. Its kind has no tag name, so the not-modeled check called Set.contains(null)
and the doclet failed with a NullPointerException. Documenting the GraalVM Truffle API hit it.
Report it as a malformed-comment problem, like an erroneous inline tag.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sgammon
Sam Gammon (sgammon) merged commit a885615 into main Nov 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant