RFR: 8323746: Add PathElement hashCode and equals [v2]

Per Minborg pminborg at openjdk.org
Thu Feb 8 09:15:09 UTC 2024


On Sat, 3 Feb 2024 11:28:51 GMT, ExE Boss <duke at openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Make all PathElements records
>
> src/java.base/share/classes/jdk/internal/foreign/LayoutPath.java line 494:
> 
>> 492:             return 63;
>> 493:         }
>> 494: 
> 
> Suggestion:

So, a record with no component will have a `hashCode()` of zero.  I didn't want the two singleton variants to have the same hash code. I've added a test for this and will remove one of the overrides.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17651#discussion_r1482636805


More information about the core-libs-dev mailing list