-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
sparc
-
solaris_2.6
Name: ooR10001 Date: 05/30/2001
javax.swing.JTable.editCellAt(int, int) and javax.swing.JTable.editCellAt(int,
int, EventObject) methods should throw IllegalArgumentException when first two
parameters are not in valid range but in fact no exception thrown.
Javadoc says:
-------------
editCellAt
public boolean editCellAt(int row,
int column)
...........................
Throws:
IllegalArgumentException - if row or column is not in the valid range
.........
editCellAt
public boolean editCellAt(int row,
int column,
EventObject e)
Throws:
IllegalArgumentException - if row or column is not in the valid range
-------------------------------------------
This test shows a bug:
----------- test.java ------------
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class test {
public static void main(String[] args) {
JTable c = new JTable();
c.setModel(new DefaultTableModel(2, 2));
c.editCellAt(-1, 3);
c.editCellAt(0, 10, new java.util.EventObject(c));
System.out.println("No exception thrown");
}
}
----------------------------------
Output:
-----------------------------
% java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
% java test
No exception thrown
-----------------------------
======================================================================
- duplicates
-
JDK-4883196 Five JTable methods should not declare @throws IllegalArgumentException
- Closed