For user-defined headings in Javadoc, start at <h2> (at class level) or <h4> (at method level). - #8576
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_954990003
branch
from
July 28, 2026 20:45
b5be729 to
3f81b2d
Compare
…) or `<h4>` (at method level). This became [the proper policy](https://bugs.openjdk.org/browse/JDK-8220379) in [JDK 13](https://bugs.openjdk.org/browse/JDK-8219801): At that point, `javadoc` started generating the top-level heading as (appropriately enough!) `<h1>` instead of the old `<h2>`. The switch lets our class-level subheadings show up in the outline on the left side of the rendered documentation, and it prevents our method-level subheadings from showing up in that outline _nested under the wrong methods_. (They disappear entirely, and that seems fine.) We may have noticed at least the `<h2>` part of this at some point, as evidenced by the `<h2>` usages in classes like https://guava.dev/CacheBuilder and in [some](https://guava.dev/releases/snapshot-jre/api/docs/com/google/common/base/package-summary.html) `package-info` files. Or maybe we just misremembered the rule :) RELNOTES=n/a PiperOrigin-RevId: 955458218
copybara-service
Bot
force-pushed
the
test_954990003
branch
from
July 28, 2026 21:06
3f81b2d to
3072ff8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For user-defined headings in Javadoc, start at
<h2>(at class level) or<h4>(at method level).This became the proper policy in JDK 13: At that point,
javadocstarted generating the top-level heading as (appropriately enough!)<h1>instead of the old<h2>.The switch lets our class-level subheadings show up in the outline on the left side of the rendered documentation, and it prevents our method-level subheadings from showing up in that outline nested under the wrong methods. (They disappear entirely, and that seems fine.)
We may have noticed at least the
<h2>part of this at some point, as evidenced by the<h2>usages in classes like https://guava.dev/CacheBuilder and in somepackage-infofiles. Or maybe we just misremembered the rule :)RELNOTES=n/a