-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.0.2
-
sparc
-
solaris_2.5, solaris_2.5.1
Name: asC58863 Date: 02/18/98
java.awt.swing.JTable.JTable(Vector data, Vector columnNames) does not
throw java.lang.IllegalArgumentException if the number of columns in
data does not equal the number of names in columnNames.
(see JavaDoc Comment )
"public JTable(Vector data,
Vector columnNames)
..............
Throws:
IllegalArgumentException - if data is null or if the number of
columns in data does not equal the number of
names in columnNames. "
This exception is not thrown starting with JDK1.2-Beta3E build only.
Here is the test demonstrating the bug:
------------------ Test.java -----------------
import java.awt.swing.*;
import java.util.*;
class Test {
public static void main(String[] argv) {
Vector data=new Vector();
data.addElement(new Vector(3));
((Vector)data.elementAt(0)).addElement(new Object());
Vector columnNames = new Vector();
try {
JTable table = new JTable(data,columnNames);
System.out.println(" IllegalArgumentException does not thrown ");
} catch(IllegalArgumentException e){
System.out.println(" thrown "+e);
}
System.exit(0);
}
}
-------------- Output from the test -----------------
:\>/set/java/JDK1.2-Beta3E/solaris/bin/java Test
IllegalArgumentException does not thrown
------------------------------------------------------
======================================================================
- duplicates
-
JDK-4115568 Method DefaultTableModel.setDataVector(Vector,Vector) doesn't throw Exception.
- Closed