RFR: 8354791: Use Hashtable.putIfAbsent in CSS constructor
Sergey Bylokhov
serb at openjdk.org
Mon Apr 28 23:43:49 UTC 2025
On Tue, 12 Nov 2024 09:13:07 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:
> We can use Hashtable.putIfAbsent instead of pair `get`/`put` methods.
> It's faster and cleaner.
src/java.desktop/share/classes/javax/swing/text/html/CSS.java line 737:
> 735: valueMapper);
> 736: Object generic = new CssValue();
> 737: for (Attribute key : Attribute.allAttributes) {
It seems that the entire method references the Attribute class via the CSS prefix.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22032#discussion_r2065032068
More information about the client-libs-dev
mailing list