Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4113014

JTable(Vector, Vector) does not throw IllegalArgumentException

XMLWordPrintable

    • 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
      ------------------------------------------------------


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

            erapinsunw Eric Rapin (Inactive)
            asemidetsunw Alexei Semidetnov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: