Name: boT120536 Date: 01/16/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
The api documentation for javax.swing.DefaultListModel.add( int, Object )
states that an ArrayIndexOutOfBoundsException is thrown under the conditions:
index < 0 || index >= size(). In the sourcecode however
javax.swing.DefaultListModel is backed by an instance of java.util.Vector and
no additional bounds checking is performed until
java.util.Vector.insertElementAt( Object, int ) is called and in this method
index < 0 || index > elementCount + 1 is checked which would be equivalent to
index < 0 || index > size() in java.swing.DefaultListModel.
(Review ID: 114281)
======================================================================