On Fri, 2 Aug 2024 22:30:25 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:

>> Michael Strauß has updated the pull request incrementally with two 
>> additional commits since the last revision:
>> 
>>  - fix since tag
>>  - adjust table styling
>
> 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.

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

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

Reply via email to