This patch (committed) fixes an ArrayIndexOutOfBoundsException in the
JTable.getRowHeight(int) method:
2006-09-22 David Gilbert <[EMAIL PROTECTED]>
* javax/swing/SizeSequence.java
(getSize): Return 0 if index is out of bounds.
Mauve tests already committed.
Regards,
Dave
Index: javax/swing/SizeSequence.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/SizeSequence.java,v
retrieving revision 1.5
diff -u -r1.5 SizeSequence.java
--- javax/swing/SizeSequence.java 21 Jun 2006 12:42:51 -0000 1.5
+++ javax/swing/SizeSequence.java 22 Sep 2006 11:17:21 -0000
@@ -129,14 +129,18 @@
}
/**
- * Returns the size of the specified element.
+ * Returns the size of the specified element, or 0 if the element index is
+ * outside the defined range.
*
* @param index the element index.
*
- * @return The size of the specified element.
+ * @return The size of the specified element, or 0 if the element index is
+ * outside the defined range.
*/
public int getSize(int index)
{
+ if (index < 0 || index >= sizes.length)
+ return 0;
return sizes[index];
}