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

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

XMLWordPrintable

    • beta
    • generic, sparc
    • generic, solaris_2.6



      Name: aaR10142 Date: 06/26/2000


      DefaultTableModel.setDataVector(data, names) docs do not specify behavior for null params.


      The method accepts null data 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[]) {
              String names[]= {"Test"};
              DefaultTableModel c = new DefaultTableModel();
              
              // set null data vector

              c.setDataVector(null, names);
              System.out.println("Accept null");
           }

      }
      -------------------jdk1.3 output ---------------------------
      Exception in thread "main" java.lang.IllegalArgumentException: setDataVector() - Null parameter
              at javax.swing.table.DefaultTableModel.setDataVector(DefaultTableModel.java:194)
              at javax.swing.table.DefaultTableModel.setDataVector(DefaultTableModel.java:222)
              at Test.main(Test.java:11)
      -------------------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: