RFR: JDK-8254052: improve type specificity of TagletWriter and friends [v2]
Jonathan Gibbons
jjg at openjdk.java.net
Thu Oct 8 15:30:22 UTC 2020
On Thu, 8 Oct 2020 13:41:09 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:
>> 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?
Hi Hannes,
The primary motivation was to cleanup TagletWriter[Impl], which
triggered the changes in Utils.
I didn't pursue the possibility of improving the clients of TagletWriter
and the downstream usage, but now that you have pointed out the
possibility, I will do so.
-- Jon
On 10/8/20 6:41 AM, Hannes Wallnoefer wrote:
>
> 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?
>
> —
> 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*issuecomment-705576262__;Iw!!GqivPVa7Brio!O1-1lTAqhH6NVFDE10ucoGdD-OdN0Hm9NZyWwHXUxMLvM6ftA7QsuzlF0MNSIYCkom7iOg$>,
> or unsubscribe
> <https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AOUXBRXZBAUIAQC3NWI6UO3SJW6QPANCNFSM4SFPSLGQ__;!!GqivPVa7Brio!O1-1lTAqhH6NVFDE10ucoGdD-OdN0Hm9NZyWwHXUxMLvM6ftA7QsuzlF0MNSIYCfQt42mA$>.
>
-------------
PR: https://git.openjdk.java.net/jdk/pull/517
More information about the javadoc-dev
mailing list