-
Enhancement
-
Resolution: Fixed
-
P5
-
None
-
b12
In the method jdk.javadoc.internal.doclets.toolkit.taglets.TagletManager#addNewSimpleCustomTag
Taglet tag = allTaglets.get(tagName);
if (tag == null || header != null) {
allTaglets.remove(tagName);
allTaglets.put(tagName, new SimpleTaglet(tagName, header, locations));
if (Utils.toLowerCase(locations).indexOf('x') == -1) {
checkTagName(tagName);
}
} else {
//Move to back
allTaglets.remove(tagName);
allTaglets.put(tagName, tag);
}
Instead of pair LinkedHashMap.get+LinkedHashMap.remove calls, we can use value returned from single allTaglets.remove call.
It's shorter and a bit faster.
Taglet tag = allTaglets.get(tagName);
if (tag == null || header != null) {
allTaglets.remove(tagName);
allTaglets.put(tagName, new SimpleTaglet(tagName, header, locations));
if (Utils.toLowerCase(locations).indexOf('x') == -1) {
checkTagName(tagName);
}
} else {
//Move to back
allTaglets.remove(tagName);
allTaglets.put(tagName, tag);
}
Instead of pair LinkedHashMap.get+LinkedHashMap.remove calls, we can use value returned from single allTaglets.remove call.
It's shorter and a bit faster.