RFR: 8289658: Avoid redundant LinkedHashMap.get call in TagletManager.addNewSimpleCustomTag [v2]

Andrey Turbanov aturbanov at openjdk.org
Mon Jul 4 16:05:45 UTC 2022


On Mon, 4 Jul 2022 15:21:38 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> Andrey Turbanov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>> 
>>  - Merge remote-tracking branch 'origin/master' into avoid_redundant_LinkedHashmap.get_in_TaglegManager
>>  - [PATCH] Avoid redundant LinkedHashMap.get call in TagletManager.addNewSimpleCustomTag
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletManager.java line 314:
> 
>> 312:             return;
>> 313:         }
>> 314:         Taglet tag = allTaglets.remove(tagName);
> 
> The logic was somewhat clearer before. This code may be correct, but it would help to have an explanatory comment.
> Note this code is only executed once per run of javadoc, so performance is definitely not an issue.

Hm.  For me the previous code is confusing. Subsequent remove+put by the same key looks like some leftovers after refactoring.
Javadoc of this method is very explanatory. New code just repeats what is written there.  Not sure if additional comment required.

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

PR: https://git.openjdk.org/jdk/pull/9137


More information about the javadoc-dev mailing list