MCPcopy Index your code
hub / github.com/davidgiven/luje / deepHashCode

Method deepHashCode

lib/java/util/Arrays.java:1097–1107  ·  view source on GitHub ↗

Returns a hash code based on the "deep contents" of the given array. If the array contains other arrays as its elements, the hash code is based on their contents not their identities. So it is not acceptable to invoke this method on an array that contains itself as an element, either directly or ind

(Object[] array)

Source from the content-addressed store, hash-verified

1095 * @return the hash code for {@code array}.
1096 */
1097 public static int deepHashCode(Object[] array) {
1098 if (array == null) {
1099 return 0;
1100 }
1101 int hashCode = 1;
1102 for (Object element : array) {
1103 int elementHashCode = deepHashCodeElement(element);
1104 hashCode = 31 * hashCode + elementHashCode;
1105 }
1106 return hashCode;
1107 }
1108
1109 private static int deepHashCodeElement(Object element) {
1110 Class<?> cl;

Callers 1

deepHashCodeElementMethod · 0.95

Calls 1

deepHashCodeElementMethod · 0.95

Tested by

no test coverage detected