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

DefaultTableModel.addColumn() docs do not specify behavior for null params

XMLWordPrintable

    • beta
    • sparc
    • solaris_2.6



      Name: aaR10142 Date: 06/26/2000


       DefaultTableModel.addColumn(columnName, columnData) docs do not specify behavior for null params.


      The method accepts null columnName in jdk1.4,
      and throws IllegalArgumentException for it in jdk1.3

      Please specify the correct behavior and if it is needed to keep new one,
      specify that the behavior was changed.

      See example:

      ------------------example--------------------
      import javax.swing.table.DefaultTableModel;

      public class Test {

          public static void main(String argv[]) {
              DefaultTableModel c = new DefaultTableModel();
              
              // add column with null name

              c.addColumn(null, new Object[0]);
              System.out.println("Accept null");
           }

      }
      -------------------jdk1.3 output ---------------------------
      Exception in thread "main" java.lang.IllegalArgumentException: addColumn() - null parameter
              at javax.swing.table.DefaultTableModel.addColumn(DefaultTableModel.java:421)
              at javax.swing.table.DefaultTableModel.addColumn(DefaultTableModel.java:456)
              at Test.main(Test.java:10)
      -------------------jdk1.4 output ---------------------------
      Accept null
      -------------------------------------------------------------

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

            sharonz Sharon Zakhour (Inactive)
            alisunw Ali Ali (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: