code: public
    void prepareCache(int size){
     if (tc.isEntryEnabled())
        tc.entry(this,cclass, "prepareCache", "size: " + size);
  
      int oldSize = (cacheTag == null) ? 0 : cacheTag.length;
  
      if (size <= oldSize) {
        // If the cache is big enough, make sure we are not out of counters
        if (generation == Integer.MAX_VALUE) {
          generation = 1;
          for (int i = 0; i < size; i++)
            cacheTag[i] = 0;
        } else generation++;
  
      if (tc.isEntryEnabled())
  	  tc.exit(this,cclass, "prepareCache");
  
        return;
      }
  
      // Allocate fresh
  
      cacheTag = new int[2*size];
      cacheValue = new Object[2*size];
  
      // Reset generation since all cache fields are null.
      generation = 1;
  
      if (tc.isEntryEnabled())
  	  tc.exit(this,cclass, "prepareCache");
    }
docs: ---------------------------------------------------------------------------