JDK-6737700 : api/javax_swing/table/DefaultTableCellRenderer/index.html#getset:DefaultTableCellRenderer
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10,7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_10
  • CPU: generic,x86
  • Submitted: 2008-08-15
  • Updated: 2012-03-22
  • Resolved: 2008-09-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u10 b33Fixed 7Fixed OpenJDK6Fixed
Related Reports
Relates :  
Description
JCK            : JCK-runtime-6a b14
J2SE           : FAIL - jdk6u10 build 12, 26, 28_j4b, 29_j4b
Platform[s]    : FAIL - solaris10(sparc, x86), solaris8(x86), suse10(x86)
switch/Mode    : FAIL - any

api/javax_swing/table/DefaultTableCellRenderer/index.html#getset:DefaultTableCellRenderer fails with folowing  output:
The failure isn't always reproducible.
Not a regression; problem is reproducible with earlier updates.

STATUS:Failed.test cases: 4; passed: 3; failed: 1; first test case failure: DefaultTableCellRenderer0001
----------out2:(4/407)----------
====== DefaultTableCellRenderer0001 ====== public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, b
====== DefaultTableCellRenderer0002 ====== public void setForeground(Color color)
====== DefaultTableCellRenderer0003 ====== public void setBackground(Color color)
====== DefaultTableCellRenderer2002 ====== public void updateUI()
result: Failed. test cases: 4; passed: 3; failed: 1; first test case failure: DefaultTableCellRenderer0001
test result: Failed. test cases: 4; passed: 3; failed: 1; first test case failure: DefaultTableCellRenderer0001


Steps for reproduce:
1. login to stt-44.russia (stt-11.russia, stt-55.russia, stt-05.russia)
2. install jdk1.6.0_10 b29 j4b to /export/JDK (full path must be /export/JDK/jdk1.6.0_10/bin/java)
3. cd /set/stt/newroot/results/1.6.0_10/b29_j4b/JCK6a/runtime-x86-SUSE10-client-Xcomp/rerun
4. run script ./DefaultTableCellRenderer_getset.sh

Script:
TEST=javasoft.sqe.tests.api.javax.swing.table.DefaultTableCellRenderer.getsetTests
export JAVA=/export/JDK/jdk1.6.0_10/bin/java
export CLASSPATH=/set/stt/jck_promotions/6a/fcs/alt2/binaries/JCK-runtime-6a/classes
OPTS="-client -Xcomp"
$JAVA  $OPTS -Xfuture -classpath $CLASSPATH -Djava.security.policy=/export/JCK/JCK-runtime-6a/lib/jck.policy $TEST

Comments
EVALUATION Relatively simple fix. The problem was that if the return value from UIManager was null, then null was being returned *unless* the developer had specifically overridden the noFocusBorder. The intent of the method is this: Get a border from UIManager for the no focus border (allows the laf to change the no focus border) If a security manager is installed (unsigned applet for instance) If the border was specified, then just return the border If the border was not specified, return the SAFE NO FOCUS BORDER Else there was no security manager If border was specified If no focus border has not be overridden by the developer return the specified border from UI Manager If all else fails, return the noFocusBorder (non null unless specifically made null by the user) Note this last line is exactly the same behavior from before Nimbus fixes -- if the user has specified the border to be null it will be null.
22-08-2008

EVALUATION The DefaultTableCellRenderer used to always have EmptyBorder(1, 1, 1, 1) which is not equal to the null border, because of 1-pixel insets it looks like a bug which changes the visual appearance of the DefaultTableCellRenderer
21-08-2008

EVALUATION I found the source of the JCK test that fails and created a standalone test case on its base. The new test is in the attachment. The bug is caused by the fix for 6595814. The fix changed DefaultTableCellRenderer.getNoFocusBorder(). Now the method can return null. The test fails because it assumes that the border of a cell renderer is always an instance of EmptyBorder. A fix can change getNoFocusBorder() in such a way that the method always returns an instance of EmptyBorder. Or maybe the JCK test can be rewritten to accept null borders if it is acceptable.
20-08-2008