private void rehash(){
  int oldCapacity=table.length;
  Object oldMap[]=table;
  int newCapacity=oldCapacity * 2 + 1;
  Object newMap[]=new Object[newCapacity];
  for (int i=oldCapacity; i-- > 0; )   if (oldMap[i] != null) {
    int index=(System.identityHashCode(oldMap[i]) & 0x7FFFFFFF) % newMap.length;
    while (newMap[index] != null)     index=(index + 1) % newMap.length;
    newMap[index]=oldMap[i];
  }
  threshold=(int)(newCapacity * loadFactor);
  table=newMap;
}

private void rehash ( ) { int oldCapacity = table . length ; Object oldMap [ ] = table ; int newCapacity = oldCapacity * 2 + 1 ; Object newMap [ ] = new Object [ newCapacity ] ; for ( int i = oldCapacity ; i -- > 0 ; ) if ( oldMap [ i ] != null ) { int index = ( System . identityHashCode ( oldMap [ i ] ) & 0x7FFFFFFF ) % newMap . length ; while ( newMap [ index ] != null ) index = ( index + 1 ) % newMap . length ; newMap [ index ] = oldMap [ i ] ; } threshold = ( int ) ( newCapacity * loadFactor ) ; table = newMap ; }
rehash . it is possible for one thread to call get method while another thread is performing rehash . keep this in mind .
