@ SuppressWarnings ( "unchecked" ) void rehash ( ) { Entry < K , V > [ ] src = entries ; if ( src == null ) { throw new CacheClosedException ( cache ) ; } int i , sl = src . length , n = sl * 2 , _mask = n - 1 , idx ; Entry < K , V > [ ] tab = new Entry [ n ] ; long _count = 0 ; Entry _next , e ; for ( i = 0 ; i < sl ; i ++ ) { e = src [ i ] ; while ( e != null ) { _count ++ ; _next = e . another ; idx = modifiedHashCode ( e . hashCode ) & _mask ; e . another = tab [ idx ] ; tab [ idx ] = e ; e = _next ; } } entries = tab ; calcMaxFill ( ) ; }
Double the hash table size and rehash the entries . Assumes total lock .