-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
sparc
-
solaris_2.5.1
Name: aaC67449 Date: 02/26/98
Methods DefaultTableModel.setDataVector(Vector newData,Vector columnIds) and setDataVector(Object[][] newData, Object[] columnIds) doesn't throw IllegalArgumentException, when the number of columns in newData does not equal the number of the column identifiers in columnIds.
Javadoc says:"
Throws:
IllegalArgumentException - if newData is null or if the number of columns in newData does not equal the number of the column identifiers in columnIds."
-------------------Example-----------------------------------
import java.util.*;
import java.awt.swing.table.*;
public class Test {
public static void main(String argv[]) {
DefaultTableModel c = new DefaultTableModel();
Vector idVector=new Vector();
Vector dataVector=new Vector();
//prepare data vector
Vector elem=new Vector();
for (int j=0;j<5;j++)
elem.addElement(new Object());
dataVector.addElement(elem);
// test
try {
c.setDataVector(dataVector,idVector);
System.out.println("Failed. IllegalArgumentException was not thrown.");
} catch(IllegalArgumentException e) {
System.out.println("OKAY");
}
}
}
-------------------Output------------------------------------
Failed. IllegalArgumentException was not thrown.
======================================================================
- duplicates
-
JDK-4113014 JTable(Vector, Vector) does not throw IllegalArgumentException
- Resolved