Back to Intellij Community

ArrayHashCode

java/java-impl/resources/inspectionDescriptions/ArrayHashCode.html

2025.3-rc-2380 B
Original Source

Reports incorrect hash code calculation for arrays.

In order to correctly calculate the hash code for an array, use:

  • Arrays.hashcode() for linear arrays
  • Arrays.deepHashcode() for multidimensional arrays

These methods should also be used with Objects.hash() when the sequence of input values includes arrays, for example: Objects.hash(string, Arrays.hashcode(array))