JDK-6266027 : Regression: javax/swing/text/html/CSS/4765271/bug4765271.java fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: x86
  • Submitted: 2005-05-05
  • Updated: 2021-02-02
  • Resolved: 2005-11-21
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
6 b42Fixed
Related Reports
Relates :  
Description
JDK        	    : Mustang b34
Platform[s]         : Fails On:  Solaris 8 x86, OpenWin
Failing Test [s]    : javax/swing/text/html/CSS/4765271/bug4765271.java


    Test source location:
    =====================
/java/re/jdk/6.0/latest/ws/j2se/test/javax/swing/text/html/CSS/4765271/bug4765271.java

    jtr file location:
    ==================
/net/cady/export6/results/mustang/b34/reg/regression-reg-IA8-2005-05-02-13-11-45-0068/workDir/javax/swing/text/html/CSS/4765271/bug4765271.jtr

    How to reproduce:
    ====================
    - Set JAVA_HOME to Mustang b34 solaris-i586
    - cd /java/re/jdk/6.0/latest/ws/j2se/test/javax/swing/text/html/CSS/4765271
    - /net/koori.sfbay/onestop/jct-tools/2.1.6/archive/fcs/binaries/solaris/bin/jtreg -r:/tmp -w:/tmp ./bug4765271.java


    Test output:
    =============
java.lang.RuntimeException: Test failed.
        at bug4765271.destroy(bug4765271.java:79)
        at com.sun.javatest.regtest.AppletWrapper$AppletThread.run(AppletWrapper.java:156)
        at java.lang.Thread.run(Thread.java:595)
STATUS:Failed.Applet thread threw exception: java.lang.RuntimeException: Test failed.


    Specific Machine Info:
    =====================
SunOS talitha 5.8 Generic_108529-29 i86pc i386 i86pc
                       Solaris 8 2/02 s28x_u7wos_08a INTEL
           Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
                           Assembled 18 December 2001

###@###.### 2005-05-05 18:22:23 GMT

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/swing_data/mustang/6266027 ###@###.### 2005-05-27 15:04:46 GMT
27-05-2005

EVALUATION The bug is in javax.swing.text.html.CSS.getFontSize() method. It can be emulated with the following code [or reproduced on system that returns 64 to the following call: <code>Toolkit.getDefaultToolkit().getScreenResolution()</code>, e.g. on the mentioned Solaris 8 x86 with OpenWindows instance]: [code] System.out.println("****************"); int res = 64; System.out.println("res = " + res); float scale = res / 2.54f; System.out.println("scale = " + scale); float value = 2.54f * scale; System.out.println("value = " + value); int value_int = (int) value; System.out.println("value_int = " + value_int); int value_int_rounded = Math.round(value); System.out.println("value_int_rounded = " + value_int_rounded); System.out.println("****************"); [code] The output is: **************** res = 64 scale = 25.19685 value = 63.999996 value_int = 63 value_int_rounded = 64 **************** Float value of 63.999996 is incorrectly _casted_ to int resulting in 63 and not 64. In the test it leads to the wrong font size of 63 for the 'E' symbol. ###@###.### 2005-05-26 16:35:40 GMT
26-05-2005