4 Replies Latest reply on Mar 14, 2008 9:34 PM by 796447

    RangeCheck throwing odd exception in ArrayList


      I'm experiencing the strangest exception with an ArrayList. Here's the stack trace (partial):

      java.lang.IndexOutOfBoundsException: Index: 0, Size: 18
           at java.util.ArrayList.RangeCheck(ArrayList.java:547)
           at java.util.ArrayList.get(ArrayList.java:322)
           at prefuse.data.CascadedTable.getColumn(CascadedTable.java:442)
           at prefuse.data.Table.getLong(Table.java:1097)
           at prefuse.data.Graph.getSourceNode(Graph.java:887)
           at prefuse.data.Graph.getAdjacentNode(Graph.java:929)
           at prefuse.data.Graph.getAdjacentNode(Graph.java:953)

      Notice the values of "index" and "size" in the message. Here's the source from ArrayList:
      private void RangeCheck(int index) {
           if (index >= size)
               throw new IndexOutOfBoundsException(
                "Index: "+index+", Size: "+size);
      Clearly, 0 < 18 (index < size), so, how in the heck am I getting this exception? Any ideas?

      Thanks for any thoughts,