RFR: JDK-8220202: Simplify/standardize method naming for HtmlTree

Jonathan Gibbons jonathan.gibbons at oracle.com
Mon Mar 11 17:17:09 UTC 2019


Thanks.

I've used this coding pattern in other projects and it has worked well 
for me.

I tried to keep this webrev to an IDE-change only;  maybe I should do a 
follow-up webrev to improve the doc comments on HtmlTree.

I don't know how to do this in an IDE, so maybe we can't, but I think 
that in new code we can move towards a more fluent style of use when 
dealing with a series of operations on a single HtmlTree, and/or 
eliminate short-lived local variables.

-- Jon

On 3/11/19 7:50 AM, Hannes Wallnöfer wrote:
> +1
>
> I wasn’t a bit fan of this change originally, but looking at the changes I can see it removes cruft and cleans up the code.
>
> Hannes
>
>
>> Am 05.03.2019 um 22:41 schrieb Jonathan Gibbons <jonathan.gibbons at oracle.com>:
>>
>> Please review a conceptually simple changeset to rename 3 methods on the internal HtmlTree class.
>>
>> `addAttr` is renamed to `put` and two overloads of `addContent` are renamed to `add`.
>>
>> All the changes to the files in src/jdk.javadoc were performed mechanically, with an IDE rename.
>>
>> One test file needed to be updated as well; within that file, the edits were done with "find and replace" in a text editor.
>>
>> Although simple, the number of use sites is large, making it a big changeset. It may be easiest to scan through the overall patch than to read the changes in each file.
>>
>> -- Jon
>>
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8220202
>> Webrev: http://cr.openjdk.java.net/~jjg/8220202/webrev.00/
>>


More information about the javadoc-dev mailing list