JDK-6232446 : Font.equals in 1.4.2 needs tightening to include the native font pointer.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-02-24
  • Updated: 2010-04-02
  • Resolved: 2005-07-26
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.
Other
1.4.2_10 b01Fixed
Related Reports
Relates :  
Description
Running in plugin if the locale specific fonts are preferred sometimes
labels in Swing UIs are clipped.
###@###.### 2005-2-24 00:21:47 GMT

Comments
EVALUATION Font.equals doesn't take into account that the composite font may be different in this case so the font metrics cache on SunGraphics2D may return a metrics object from an inappropiate font. This bug is 1.4.2_X only. It is not present in 1.5 or later. ###@###.### 2005-2-24 00:21:47 GMT
2005-02-24

SUGGESTED FIX There's a very simple fix for this. Make Font.equals additionally compare the Java "long"s which hold the pointer addresses for the "peers". They'll be different for each of these cases. % sccs diffs -C Font.java ------- Font.java ------- *** /tmp/sccs.FjaO5w Wed Feb 23 10:56:44 2005 --- Font.java Wed Feb 23 10:55:10 2005 *************** *** 1100,1105 **** --- 1100,1106 ---- return (size == font.size) && (pointSize == font.pointSize) && (style == font.style) + && (pNativeFont == font.pNativeFont) && name.equals(font.name) && thismat[0] == thatmat[0] && thismat[1] == thatmat[1] ###@###.### 2005-2-24 00:21:47 GMT
2005-02-24