RFR: JDK-8316972: Add javadoc support for restricted methods

Hannes Wallnöfer hannesw at openjdk.org
Fri Oct 13 16:46:18 UTC 2023


Please review a change to add support for restricted methods to JavaDoc. The bulk of this patch was contributed by @mcimadamore. It adds a warning note to the summary and details of restricted methods and a superscript to links to restricted methods, similar to what we already do with elements belonging to preview APIs. I added a summary page to list all restricted methods as well as a test.

To see the wording of this feature in context, the relevant parts of generated documentation can be reviewed here:

- [Method summary](https://cr.openjdk.org/~hannesw/8316972/api.00/java.base/java/lang/foreign/AddressLayout.html#method-summary)
- [Method details](https://cr.openjdk.org/~hannesw/8316972/api.00/java.base/java/lang/foreign/AddressLayout.html#withTargetLayout(java.lang.foreign.MemoryLayout))
- [Restricted Methods list](https://cr.openjdk.org/~hannesw/8316972/api.00/restricted-list.html)
- [Restricted Methods help section](https://cr.openjdk.org/~hannesw/8316972/api.00/help-doc.html#restricted)

Since the messages for deprecated, preview, and restricted elements all use the same CSS in our default stylesheet, I decided to combine them into a single CSS rule. It is still possible to define distinct styles for these features in user-provided stylesheets.

-------------

Commit messages:
 - More whitespace removal
 - Fix link in help page
 - Fix indentation and remove whitespace
 - Fix indentation
 - Add test for combined preview/restricted superscript
 - Remove unused message
 - Add test and help page section
 - JDK-8316972: Add javadoc support for restricted methods

Changes: https://git.openjdk.org/jdk/pull/16188/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16188&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8316972
  Stats: 543 lines in 24 files changed: 516 ins; 11 del; 16 mod
  Patch: https://git.openjdk.org/jdk/pull/16188.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16188/head:pull/16188

PR: https://git.openjdk.org/jdk/pull/16188


More information about the javadoc-dev mailing list