[jdk18] RFR: JDK-8273452: DocTrees.getDocCommentTree should be specified as idempotent

Hannes Wallnöfer hannesw at openjdk.java.net
Thu Dec 16 11:12:09 UTC 2021


Please review a doc-only change to add implementation notes to the `DocTrees.getDocCommentTree` methods, some of which return the same `DocCommentTree` instance on repeated invocation and some don't. I decided to use `@implNote` instead of `@implSpec` as usually I wouldn't expect object identity to be part of a Java API specification.

I verified the described behavior using code analysis and enhancing existing tests. The latter are not included in the commit as this is a `noreg-doc` issue.

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

Commit messages:
 - JDK-8273452: DocTrees.getDocCommentTree should be specified as idempotent

Changes: https://git.openjdk.java.net/jdk18/pull/36/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk18&pr=36&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8273452
  Stats: 12 lines in 1 file changed: 12 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk18/pull/36.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk18 pull/36/head:pull/36

PR: https://git.openjdk.java.net/jdk18/pull/36


More information about the compiler-dev mailing list