Skip to content

For user-defined headings in Javadoc, start at <h2> (at class level) or <h4> (at method level). - #8576

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_954990003
Jul 28, 2026
Merged

For user-defined headings in Javadoc, start at <h2> (at class level) or <h4> (at method level).#8576
copybara-service[bot] merged 1 commit into
masterfrom
test_954990003

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

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, 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 package-info files. Or maybe we just misremembered the rule :)

RELNOTES=n/a

…) 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
copybara-service Bot merged commit 3072ff8 into master Jul 28, 2026
@copybara-service
copybara-service Bot deleted the test_954990003 branch July 28, 2026 21:06
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