JDK-6986130 : ClassCastException in Font2D getStrike call
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u21
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86
  • Submitted: 2010-09-20
  • Updated: 2012-03-20
  • Resolved: 2011-03-14
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b17, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Windows 7

A DESCRIPTION OF THE PROBLEM :
In a stack trace that was retrieved by our support department,
sun.java2d.SunGraphics2D.checkFontInfo called
sun.font.Font2D.getStrike(Font,AffineTransform,AffineTransform,int,int)
This calls
sun.font.Font2D.getStrike(FontStrikeDesc,boolean).
This is the method where the ClassCastException with reference to SoftReference happened.  There are 3 explicit casts in this method, 2 dealing with References.

Without line numbers, it is my strong belief that the problem happened at

((StrikeCache.DisposableStrike)reference).getDisposer().dispose();
I think the following bug is related.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6926209


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Unknown

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Text showing on buttons.
ACTUAL -
The problem is that the text would not show and could not proceed in the application.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.ClassCastException: java.lang.ref.SoftReference
at sun.font.Font2D.getStrike(Unknown Source)
at sun.font.Font2D.getStrike(Unknown Source)
at sun.java2d.SunGraphics2D.checkFontInfo(Unknown Source)
at sun.java2d.SunGraphics2D.getFontInfo(Unknown Source)
at sun.java2d.pipe.GlyphListPipe.drawString(Unknown Source)
at sun.java2d.pipe.ValidatePipe.drawString(Unknown Source)
at sun.java2d.SunGraphics2D.drawString(Unknown Source)
at com.sun.java.swing.SwingUtilities2.drawString(Unknown Source)
at com.sun.java.swing.SwingUtilities2.drawStringUnderlineCharAt(Unknown Source)
at javax.swing.plaf.basic.BasicLabelUI.paintEnabledText(Unknown Source)
at javax.swing.plaf.basic.BasicLabelUI.paint(Unknown Source)
at javax.swing.plaf.ComponentUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)

REPRODUCIBILITY :
This bug can be reproduced rarely.

CUSTOMER SUBMITTED WORKAROUND :
Restarted application