title: oldData in ArrayList implementation
body: <p>I'm reading <a href="http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/ArrayList.java/?v=source" rel="noreferrer">ArrayList</a> implementation and can't understand one thing in this method:</p>
  
  <pre><code>public void ensureCapacity(int minCapacity) {
      modCount++;
      int oldCapacity = elementData.length;
      if (minCapacity &gt; oldCapacity) {
          Object oldData[] = elementData;
          int newCapacity = (oldCapacity * 3)/2 + 1;
          if (newCapacity &lt; minCapacity)
              newCapacity = minCapacity;
          // minCapacity is usually close to size, so this is a win:
          elementData = Arrays.copyOf(elementData, newCapacity);
      }
  }
  </code></pre>
  
  <p>I don't understand what this <code>oldData</code> array is used for:</p>
  
  <pre><code>Object oldData[] = elementData;
  </code></pre>
  
  <p>To me it seems like there is absolutely no sense in this local variable inside <code>ensureCapacity</code> method.</p>