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

JTable(Vector, Vector) does not throw IllegalArgumentException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.0.2
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.0.2
    • CPU:
      sparc
    • OS:
      solaris_2.5, solaris_2.5.1

      Description



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


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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: