JDK-6603975 : ClassCastException in the Font(Map)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-09-12
  • Updated: 2011-04-05
  • Resolved: 2011-04-05
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
6u10Fixed 7 b22Fixed
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
When i am using  the below statement

Font  f = new Font(Map attributes);

Than with JDK1.4/1.5 it is working fine but if i use this statement with JDK1.6 than it is throwing below exception:

java.lang.ClassCastException: java.lang.String cannot be cast to java.text.AttributedCharacterIterator$Attribute
	at sun.font.AttributeValues.merge(AttributeValues.java:305)
	at sun.font.AttributeValues.fromMap(AttributeValues.java:341)
	at java.awt.Font.<init>(Font.java:645)



REPRODUCIBILITY :
This bug can be reproduced always.

Release Regression From : 6
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
EVALUATION will ignore strings in the map
13-09-2007