-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.2, 1.3.1, 1.4.0
-
generic, sparc
-
generic, solaris_2.6
Name: ooR10001 Date: 06/04/2001
javax.swing.JTable.isRowSelected(int row) does not throw
IllegalArgumentException when row is not in the valid range. It
contradicts with current javadoc which says:
-----------------
isColumnSelected
public boolean isRowSelected(int row)
...........................
Throws:
IllegalArgumentException - if row is not in the valid range
-----------------
Following test shows the 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(new DefaultTableModel(1, 1));
try {
c.isRowSelected(-1);
System.out.println("Exception is not thrown");
} catch (IllegalArgumentException iae) {
}
}
}
----------------------------------------------
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
Exception is not thrown
------------------------------
======================================================================
- duplicates
-
JDK-4883196 Five JTable methods should not declare @throws IllegalArgumentException
- Closed