On Fri, 4 Aug 2023 21:40:37 GMT, Valerie Peng <valer...@openjdk.org> wrote:

> Why changing the ordering?

The order was changed to be parallel with that of `equals`.

> I was wondering if you'd change this to Objects.hash(...) with all the fields 
> as arguments.

Sure, we could use a convenience method, but because `eData` is an array, it 
should be `Arrays.deepHashCode(..., eData, ...)` or this construct:

    Objects.hash(..., Arrays.hashCode(eData), ...)

Bottom line: as long as we include all eData elements in the computation, we 
should be fine. If we fail to do that, we'll violate the equals-hashCode 
contract.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14738#discussion_r1284876142

Reply via email to