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

Adding an empty row to DefaultTableModel causes NullPointerException.

    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

      Description

      I'm currently working with the JTable component using
      the DefaultTableModel. Into the TableModel i want
      to insert an empty row of data via
      addRow((Vector) null).
      As a result a got an NullPointerException. I looked
      in the code of DefaultTableModel and found the following

       538: if (newRow == null)
                      newRow = new Vector(numColumns);
       540: dataVector.addElement(rowData);

      I think, line 540 has to be changed to
       540: dataVector.addElement(newRow);

      regards
      Ulrich

      //////////////////////////////////////////////
      Ulrich Schaefer
      Daimler-Benz AG
      CAE-Research (FT3/EK)
      P.O. Box 2360
      D-89013 Ulm, Germany
      Phone: +49 731 505-2846
      Fax: +49 731 505-4210
      //////////////////////////////////////////////

        Attachments

          Activity

            People

            Assignee:
            erapinsunw Eric Rapin (Inactive)
            Reporter:
            pchusunw Patience Chu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: