JDK-4465732 : javax.swing.JTable.isCellSelected() does not throw IAE
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 2001-06-04
  • Updated: 2004-03-29
  • Resolved: 2003-06-24
Related Reports
Duplicate :  
Description

Name: ooR10001			Date: 06/04/2001


javax.swing.JTable.isSelected(int row, int column) does not throw 
IllegalArgumentException when row or column are not in the valid range. It 
contradicts with current javadoc which says:

-----------------
isCellSelected

public boolean isCellSelected(int row,
                              int column)

...........................
  Throws:
        IllegalArgumentException - if row or column are 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.isCellSelected(-1, 0);
          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

------------------------------

======================================================================

Comments
EVALUATION Consolidated with three other bugs in 4883196. ###@###.### 2003-06-24
24-06-2003