Returns a hash code based on the contents of the given array. For any two boolean arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by thi
(boolean[] array)
| 810 | * @return the hash code for {@code array}. |
| 811 | */ |
| 812 | public static int hashCode(boolean[] array) { |
| 813 | if (array == null) { |
| 814 | return 0; |
| 815 | } |
| 816 | int hashCode = 1; |
| 817 | for (boolean element : array) { |
| 818 | // 1231, 1237 are hash code values for boolean value |
| 819 | hashCode = 31 * hashCode + (element ? 1231 : 1237); |
| 820 | } |
| 821 | return hashCode; |
| 822 | } |
| 823 | |
| 824 | /** |
| 825 | * Returns a hash code based on the contents of the given array. For any two |
no test coverage detected