United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6737700 api/javax_swing/table/DefaultTableCellRenderer/index.html#getset:DefaultTableCellRenderer
JDK-6737700 : api/javax_swing/table/DefaultTableCellRenderer/index.html#getset:DefaultTableCellRenderer

Details
Type:
Bug
Submit Date:
2008-08-15
Status:
Closed
Updated Date:
2012-03-22
Project Name:
JDK
Resolved Date:
2008-09-24
Component:
client-libs
OS:
generic,solaris_10
Sub-Component:
javax.swing
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u10,7
Fixed Versions:
6u10 (b33)

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

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

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.
                                     
2008-08-20
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
                                     
2008-08-21
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.
                                     
2008-08-22



Hardware and Software, Engineered to Work Together