@ SuppressWarnings ( "unchecked" ) void resize ( int newCapacity ) { Entry < K , V > [ ] oldTable = table ; int oldCapacity = oldTable . length ; if ( oldCapacity == MAXIMUM_CAPACITY ) { threshold = Integer . MAX_VALUE ; return ; } Entry < K , V > [ ] newTable = new Entry [ newCapacity ] ; transfer ( newTable ) ; table = newTable ; threshold = ( int ) ( newCapacity * loadFactor ) ; }
Rehashes the contents of this map into a new array with a larger capacity . This method is called automatically when the number of keys in this map reaches its threshold .