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

Hannes Wallnöfer hannesw at openjdk.java.net
Thu Oct 8 13:43:45 UTC 2020


On Wed, 7 Oct 2020 23:44:22 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> Looks good. I think at one point we were wondering if Utils has become too big for its own good, maybe time to refactor
>> Utils.java
>
> One way to split utils would be to divide along the lines of:
> 
> 1. convenience methods on Element/TypeMirror/Annotation (i.e.
> javax.lang.model API) only
> 2. convenience methods on DocTree and its subtypes
> 
> which just leaves in limbo the methods that use both ;-)
> 
> -- Jon
> 
> On 10/7/20 3:57 PM, Kumar Srinivasan wrote:
>>
>> *@kusrinivasan* commented on this pull request.
>>
>> Looks good. I think at one point we were wondering if Utils has become
>> too big for its own good, maybe time to refactor Utils.java
>>
>>>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/517*pullrequestreview-504323987__;Iw!!GqivPVa7Brio!MW8-iBXArYwZsjaif0MPEm5Lwy3vDGfleGBw9AFGjx69hkLszfV-IUyZL57XIHPT5u_pcw$>,
>> or unsubscribe
>> <https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AOUXBRVST5UWAQ6T2F6ZQXTSJTW6DANCNFSM4SFPSLGQ__;!!GqivPVa7Brio!MW8-iBXArYwZsjaif0MPEm5Lwy3vDGfleGBw9AFGjx69hkLszfV-IUyZL57XIHOVqeBrkQ$>.
>>

It looks like this doesn't go all the way to make the code more type specific. For example, there are several instances
of this in the code:

    `List<? extends DocTree> tags = utils.getDeprecatedTrees(klass);`

And as a consequence there are methods like HtmlDocletWriter#addInlineDeprecatedComment that could use more specific
parameter types (`DeprecatedTree` instead of `DocTree`). Is there some method to this, e.g. only use specific types to
avoid casts, or is this an oversight?

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

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


More information about the javadoc-dev mailing list