code: private void rehash()
      {
          int size = mSymbols.length;
          int newSize = size + size;
          String[] oldSyms = mSymbols;
          Bucket[] oldBuckets = mBuckets;
          mSymbols = new String[newSize];
          mBuckets = new Bucket[newSize >> 1];
          // Let's update index mask, threshold, now (needed for rehashing)
          mIndexMask = newSize - 1;
          mSizeThreshold += mSizeThreshold;
          
          int count = 0; // let's do sanity check
  
          /* Need to do two loops, unfortunately, since spillover area is
           * only half the size:
           */
          for (int i = 0; i < size; ++i) {
              String symbol = oldSyms[i];
              if (symbol != null) {
                  ++count;
                  int index = calcHash(symbol) & mIndexMask;
                  if (mSymbols[index] == null) {
                      mSymbols[index] = symbol;
                  } else {
                      int bix = index >> 1;
                      mBuckets[bix] = new Bucket(symbol, mBuckets[bix]);
                  }
              }
          }
  
          size >>= 1;
          for (int i = 0; i < size; ++i) {
              Bucket b = oldBuckets[i];
              while (b != null) {
                  ++count;
                  String symbol = b.getSymbol();
                  int index = calcHash(symbol) & mIndexMask;
                  if (mSymbols[index] == null) {
                      mSymbols[index] = symbol;
                  } else {
                      int bix = index >> 1;
                      mBuckets[bix] = new Bucket(symbol, mBuckets[bix]);
                  }
                  b = b.getNext();
              }
          }
  
          if (count != mSize) {
              throw new IllegalStateException("Internal error on SymbolTable.rehash(): had "+mSize+" entries; now have "+count+".");
          }
      }
docs: Method called when size (number of entries) of symbol table grows
  so big that load factor is exceeded. Since size has to remain
  power of two, arrays will then always be doubled. Main work
  is really redistributing old entries into new String/Bucket
  entries.