Inspectopedia Help

'hashCode()' called on array

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))

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023