Comment From: wind57
this is mainly a continuation of this PR.
-
All
nullSafeHashCode
are deprecated in favor ofArrays::hashCode
. The only difference between existing methods and the ones fromjava.util.Arrays
isINITIAL_HASH
; which in case of hashCode makes no difference. As such, why keep the implementation at all? Deprecate and delegate. -
The look-up is now done via a
Map
, instead of nestedif/else
statements, just like in the previous PR. All the same reasons apply (as to why thatinnerWildcardCapture
exists). I have introduce one more type parameter, so that the previous PR can re-use the same method. One needsFunction<?, String>
and this PR needsFunction<?, Integer>
, so adding one more type parameter, will make both happy. -
I have also changed the tests; I find it weird to test hashCode relying on implementation details. hashCode/equals should only test the contract of the methods.
Comment From: snicoll
Closing for the same reason exposed in https://github.com/spring-projects/spring-framework/pull/25591#issuecomment-1693326786. Thanks for the PR, in any case!