RFR: JDK-8309566: Migrate away from TagletWriter and TagletWriterImpl

Pavel Rappo prappo at openjdk.org
Mon Jul 10 18:30:12 UTC 2023


On Mon, 10 Jul 2023 16:03:12 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java line 107:
>> 
>>> 105:      * The context in which to generate the output for a series of {@code DocTree} nodes.
>>> 106:      */
>>> 107:     public final Context context;
>> 
>> I dislike it when a variable is accessible both directly and through the getter. Nonencapsulated fields like that is harder to debug and maintain. That said, I realise that it's somewhat of a pattern in jdk.javadoc. So, no need to change it at this time; I just make an observation.
>
> Observation noted. For my part, I don't mind non-encapsulated fields if they are final.  I prefer that style to the "noisy" parens of getter methods:
> 
> var x = utils.something;
> var x = utils().something;

My comment was about fields that are BOTH accessible directly and through the getter. To me, it's an either-or situation.

Regardless, don't bother with changing it now. I just felt like it's a good opportunity to raise that general concern.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14793#discussion_r1258684441


More information about the javadoc-dev mailing list