RFR: JDK-8234682: The order of @param in the generated docs should match the method signature

Hannes Wallnöfer hannesw at openjdk.java.net
Wed Jan 12 15:14:44 UTC 2022


Please review a change in how documentation from `@param` tags is generated. 

The old code generates parameter documentation for each `@param` in the order in which the tags occur in the comment, then adds documentation from inherited `@param` tags for undocumented parameters. 

The new code always generates documentation in the order in which actual parameters are declared in the code, using local or inherited `@param` tags as appropriate. Any `@param` tags that do not have a matching parameter are added afterwards.

Note that `@param` is not just used for parameters of executable members but also type parameters and record components. The second commit of this PR fixes a `ClassCastException` for these uses that was caused by the first commit and adds a few tests for it.

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

Commit messages:
 - JDK-8234682: Fix and add tests for generic type parameters and record components
 - JDK-8234682: The order of @param in the generated docs should match the method signature

Changes: https://git.openjdk.java.net/jdk/pull/7046/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7046&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8234682
  Stats: 173 lines in 4 files changed: 94 ins; 34 del; 45 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7046.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7046/head:pull/7046

PR: https://git.openjdk.java.net/jdk/pull/7046


More information about the javadoc-dev mailing list