RFR: JDK-8254052: improve type specificity of TagletWriter and friends [v6]

Jonathan Gibbons jjg at openjdk.java.net
Fri Oct 30 17:21:05 UTC 2020


> The types of `DocTree` parameters in some methods in `TagletWriter` can be changed from `DocTree` to more specific subtypes. Doing so makes the code less prone to incorrect calls, and removes the need for downcasting the argument in the method bodies.
> 
> This means the implementation of those methods can often be simplified.
> 
> In addition, the call sites need to be improved, and with the help of some improvements to methods in `Utils`, the methods that access different kinds of trees can return the lists using a more specific subtype as well.
> 
> Finally, a quick analysis of some of the `Utils` methods to access different kinds of trees shows that there are some more convenient methods that can be used instead.

Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits:

 - Merge master
 - post-merge fix
 - Merge master
 - review feedback: improve type specificity of use of utils.get*Trees
 - Merge master
 - JDK-8254052: improve type specificity of TagletWriter and friends

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

Changes: https://git.openjdk.java.net/jdk/pull/517/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=517&range=05
  Stats: 159 lines in 22 files changed: 55 ins; 18 del; 86 mod
  Patch: https://git.openjdk.java.net/jdk/pull/517.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/517/head:pull/517

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


More information about the javadoc-dev mailing list