title: Java Vector - Array index out of bounds
body: <p>This seems trivial, but perhaps my understanding of Vectors is not what it should be.  I'm getting <strong>[java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1]</strong> on this code.  The error occurs on line 3.    Since the look is based on the size of the Vector, how can the array go out of bounds?</p>
  <p>The method &quot;getChangeSets()&quot; returns a List.  The List was originally created as a Vector.</p>
  <pre><code>2   for (int i = 0; i &lt; getChangeSets().size(); i++) {
  3       ChangeSet currentChangeSet = getChangeSets().get(i);
  4       if (currentChangeSet.getSequentialNumber() == sequentialNumber) {
  5           return currentChangeSet;
  6       }
  7   }
  </code></pre>