JDK-6857057 : api/javax_swing/text/GlyphView/index.html#Methods test fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10,6u14,6u14-rev,6u15-rev,6u18
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2009-07-02
  • Updated: 2012-03-22
  • Resolved: 2009-08-25
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
6u16-rev b02Fixed 7Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
JCK api/javax_swing/text/GlyphView/index.html#Methods test fails for jdk 1.6.0_14 b10 REV

JCK            : JCK runtime 6b b24
J2SE           : FAIL - since jdk 1.6.0_14 build 10 REV
Platform[s]    : FAIL - Any (Windows 2003(x86), Solaris10(x86), Win XP Home(x86))
Java options   : FAIL - Any

api/javax_swing/text/GlyphView/index.html#Methods fails with folowing  output:
GlyphView2002: Passed. OKAY
GlyphView2003: Passed. OKAY
GlyphView2004: Passed. OKAY
GlyphView2005: Passed. OKAY
GlyphView2006: Passed. OKAY
GlyphView2007: Passed. OKAY
GlyphView2008: Passed. OKAY
GlyphView2009: Passed. OKAY
GlyphView2010: Passed. OKAY
GlyphView2011: Passed. OKAY
GlyphView2012: Passed. OKAY
GlyphView2013: Passed. OKAY
GlyphView2014: Passed. OKAY
GlyphView2015: Passed. OKAY
GlyphView2016: Passed. OKAY
GlyphView2017: Passed. OKAY
GlyphView2018: Passed. OKAY
GlyphView2019: Passed. OKAY
GlyphView2020: Passed. OKAY
GlyphView2021: Failed. GlyphView2021 failed: 2
GlyphView2022: Passed. OKAY
GlyphView2023: Passed. OKAY
GlyphView2024: Passed. OKAY
STATUS:Failed.test cases: 23; passed: 22; failed: 1; first test case failure: GlyphView2021
----------out2:(27/1160)----------
 === public void setGlyphPainter(GlyphPainter p) ===
 === public Segment getText(int p0, int p1) ===
 === public Color getBackground() ===
null
 === public Color getForeground() ===
java.awt.Color[r=0,g=0,b=0]
 === public Font getFont() ===
java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=12]
 === public boolean isUnderline() ===
 === public boolean isStrikeThrough() ===
 === public boolean isSubscript() ===
 === public boolean isSuperscript() ===
 === public TabExpander getTabExpander() ===
 === protected void checkPainter() ===
 === public float getTabbedSpan(float x, TabExpander e) ===
84.0
 === public float getPartialSpan(int p0, int p1) ===
 === public int getStartOffset() ===
 === public int getEndOffset() ===
 === public float getPreferredSpan(int axis) ===
 === public float getAlignment(int axis) ===
 === modelToView  ===
 === modelToView  ===
 === public int getBreakWeight(int axis, float pos, float len) ===
 === public View breakView(int axis, int p0, float pos, float len) ===
 === public View createFragment(int p0, int p1) ===
 === protected final Object clone() ===
result: Failed. test cases: 23; passed: 22; failed: 1; first test case failure: GlyphView2021
My test passed:
java version "1.6.0_14"
Java(TM) Platform, Standard Edition for Business (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode)

GlyphView2002: Passed. OKAY
GlyphView2003: Passed. OKAY
GlyphView2004: Passed. OKAY
GlyphView2005: Passed. OKAY
GlyphView2006: Passed. OKAY
GlyphView2007: Passed. OKAY
GlyphView2008: Passed. OKAY
GlyphView2009: Passed. OKAY
GlyphView2010: Passed. OKAY
GlyphView2011: Passed. OKAY
GlyphView2012: Passed. OKAY
GlyphView2013: Passed. OKAY
GlyphView2014: Passed. OKAY
GlyphView2015: Passed. OKAY
GlyphView2016: Passed. OKAY
GlyphView2017: Passed. OKAY
GlyphView2018: Passed. OKAY
GlyphView2019: Passed. OKAY
GlyphView2020: Passed. OKAY
GlyphView2021: Passed. OKAY
GlyphView2022: Passed. OKAY
GlyphView2023: Passed. OKAY
GlyphView2024: Passed. OKAY
 === public void setGlyphPainter(GlyphPainter p) ===
 === public Segment getText(int p0, int p1) ===
 === public Color getBackground() ===
null
 === public Color getForeground() ===
java.awt.Color[r=0,g=0,b=0]
 === public Font getFont() ===
java.awt.Font[family=Monospaced,name=Monospaced,style=plain,size=12]
 === public boolean isUnderline() ===
 === public boolean isStrikeThrough() ===
 === public boolean isSubscript() ===
 === public boolean isSuperscript() ===
 === public TabExpander getTabExpander() ===
 === protected void checkPainter() ===
 === public float getTabbedSpan(float x, TabExpander e) ===
84.0
 === public float getPartialSpan(int p0, int p1) ===
 === public int getStartOffset() ===
 === public int getEndOffset() ===
 === public float getPreferredSpan(int axis) ===
 === public float getAlignment(int axis) ===
 === modelToView  ===
 === modelToView  ===
 === public int getBreakWeight(int axis, float pos, float len) ===
 === public View breakView(int axis, int p0, float pos, float len) ===
 === public View createFragment(int p0, int p1) ===
 === protected final Object clone() ===
STATUS:Passed.test cases: 23; all passed

Comments
SUGGESTED FIX Webrev (JDK): http://sa.sfbay.sun.com/projects/swing_data/6u14-rev/6857057.0
16-07-2009

EVALUATION The problem as described here is in the test, but there's also the *real* problem: a developer may *intentionally* request a break weight on the small view fragment, like the test does by mistake. And the results will be different after the fix for 6760148 and 6832120. What is calculated now is the correct result. But I do agree that we shouldn't change behaviors in the update releases if we can. In fact, there's the possibility to restore the old behavior of getBreakWeight without reverting the fix for 6760148. The method is to restrict offset adjustment introduced in 6760148 to JTextArea *only*, and let the other parts of the game behave the old way. This is not "right" from the technical point of view, but solves all the problems we encounter. But the test shoult be fixed too, anyway.
14-07-2009

EVALUATION Agreed with ###@###.###, the problem is in JCK test
10-07-2009

EVALUATION The test GlyphView2021 mis-uses the parameters `pos' and `len' to the GlyphView.getBreakWeight method. These parameters are expected to be in font-related units (pixels or whatever), but in the test they are passed as logical offsets into document (i.e., a number of characters). So in 2-nd run an interval passed to getBreakWeight is 12, and the width of two characters is 14. So they don't fit and there's no breakpoint in the region. This worked before due to the fact that Utilities.getTabbedTextOffset might return an offset that doesn't actually fit in the passed area (this is CR 6760148). Now it's forbidden. The test should be fixed to use the right units as the parameters.
10-07-2009

PUBLIC COMMENTS please supply more inforamtion: 1) from which version it begins fail; 2) how to reproduce, the test env setting, host, access information etc.
02-07-2009