148 |
|
/** |
149 |
|
* Applies a supplemental hash function to a given hashCode, which |
150 |
|
* defends against poor quality hash functions. This is critical |
151 |
< |
* because HashMap uses power-of two length hash tables, that |
152 |
< |
* otherwise encounter collisions for hashCodes that do not differ |
153 |
< |
* in lower bits. |
151 |
> |
* because ConcurrentHashMap uses power-of-two length hash tables, |
152 |
> |
* that otherwise encounter collisions for hashCodes that do not |
153 |
> |
* differ in lower bits. |
154 |
|
*/ |
155 |
< |
static int hash(int h) { |
155 |
> |
private static int hash(int h) { |
156 |
|
// This function ensures that hashCodes that differ only by |
157 |
|
// constant multiples at each bit position have a bounded |
158 |
|
// number of collisions (approximately 8 at default load factor). |