On Fri, 1 Nov 2024 14:43:39 GMT, Andrey Turbanov <aturba...@openjdk.org> wrote:
> Static and non-static `CSS.LengthUnit.getValue` methods essentially do the > same thing. > https://github.com/openjdk/jdk/blob/751a914b0a377d4e1dd30d2501f0ab4e327dea34/src/java.desktop/share/classes/javax/swing/text/html/CSS.java#L3085-L3096 > > https://github.com/openjdk/jdk/blob/751a914b0a377d4e1dd30d2501f0ab4e327dea34/src/java.desktop/share/classes/javax/swing/text/html/CSS.java#L3098-L3108 > > 1. delegate one to another to reduce code duplication. > 2. use primitive `boolean` type as parameter to avoid boxing > 3. take advantage of `Map.getOrDefault()` to simplify code futher The tests are green, too. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21833#issuecomment-2602265953