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

javax.swing.JTable methods fire newValue to Listener instead of old one

    XMLWordPrintable

Details

    • beta
    • x86
    • linux
    • Verified

    Description



      Name: skR10017 Date: 05/24/2000



      Methods JTable.setShowHorizontalLines(boolean) and JTable.setShowVerticalLines(boolean)
      contain a bug.

      Here are two citations from the source file:

      ------------------ src/javax/swing/JTable.java --------------------

          public void setShowHorizontalLines(boolean showHorizontalLines) {
              boolean old = showHorizontalLines;
      // ^^^^^^^^^^^^^^^^^^^ here showHorizontalLines
      // is function argument not old value of property
      this.showHorizontalLines = showHorizontalLines;
      firePropertyChange("showHorizontalLines", old, showHorizontalLines);

              // Redraw
              repaint();
          }

          public void setShowVerticalLines(boolean showVerticalLines) {
              boolean old = showVerticalLines;
      // ^^^^^^^^^^^^^^^^^^^ here showVerticalLines
      // is function argument not old value of property
              this.showVerticalLines = showVerticalLines;
      firePropertyChange("showVerticalLines", old, showVerticalLines);
              // Redraw
              repaint();
          }
      --------------------------------------------------------------------------------

      because of this bug the old value is always equal to the new value. It leads to
      failure of BeanCounter test from Swing testsuite.

      This bug affects JDK1.3 for Linux(beta06) and Solaris(build 1.3.0rc3-Z)

      Suggestion fix:
      To insert "this." into the first strings of every method described:

      for setShowHorizontalLines method:
              boolean old = this.showHorizontalLines;

      for setShowVerticalLines method:
              boolean old = this.showVerticalLines;

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

      Attachments

        Activity

          People

            pmilnesunw Philip Milne (Inactive)
            kotlsunw Kotl Kotl (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: