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

Method deepHashCodeElement

lib/java/util/Arrays.java:1109–1149  ·  view source on GitHub ↗
(Object element)

Source from the content-addressed store, hash-verified

1107 }
1108
1109 private static int deepHashCodeElement(Object element) {
1110 Class<?> cl;
1111 if (element == null) {
1112 return 0;
1113 }
1114
1115 cl = element.getClass().getComponentType();
1116
1117 if (cl == null) {
1118 return element.hashCode();
1119 }
1120
1121 /*
1122 * element is an array
1123 */
1124 if (!cl.isPrimitive()) {
1125 return deepHashCode((Object[]) element);
1126 }
1127 if (cl.equals(int.class)) {
1128 return hashCode((int[]) element);
1129 }
1130 if (cl.equals(char.class)) {
1131 return hashCode((char[]) element);
1132 }
1133 if (cl.equals(boolean.class)) {
1134 return hashCode((boolean[]) element);
1135 }
1136 if (cl.equals(byte.class)) {
1137 return hashCode((byte[]) element);
1138 }
1139 if (cl.equals(long.class)) {
1140 return hashCode((long[]) element);
1141 }
1142 if (cl.equals(float.class)) {
1143 return hashCode((float[]) element);
1144 }
1145 if (cl.equals(double.class)) {
1146 return hashCode((double[]) element);
1147 }
1148 return hashCode((short[]) element);
1149 }
1150
1151 /**
1152 * Compares the two arrays.

Callers 1

deepHashCodeMethod · 0.95

Calls 7

deepHashCodeMethod · 0.95
hashCodeMethod · 0.95
getComponentTypeMethod · 0.80
getClassMethod · 0.80
isPrimitiveMethod · 0.80
hashCodeMethod · 0.65
equalsMethod · 0.65

Tested by

no test coverage detected