-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
beta
-
x86
-
linux
-
Verified
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;
======================================================================