RFR: 8332895: Support interpolation for backgrounds and borders [v3]

Michael Strauß mstrauss at openjdk.org
Sun Aug 4 19:08:15 UTC 2024


On Sat, 3 Aug 2024 10:08:14 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/javafx/scene/Node.java line 9020:
>> 
>>> 9018:             if (timer != null) {
>>> 9019:                 if (result == null) {
>>> 9020:                     result = new HashMap<>(5);
>> 
>> I think that when you specify map sizes like this, it might be worth a comment at the intent.  Did you intend to create a map that can hold 6 items before resizing?  (5 becomes 8, which is sufficient for 6 mappings with a 75% load factor).  If you want to express the intent more clearly, use `HashMap.newHashMap(5)`.
>
> I feel that the default initial capacity of 16 is more than can be reasonably expected for transitions. However, I did not use any rigorous methodology to come up with the number 5. I can add a comment, though.

I've added a comment and switched to `HashMap.newHashMap` as you suggested.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1522#discussion_r1703353352


More information about the openjfx-dev mailing list