JDK-6394028 : size key is missing in StyleContext.DEFAULT_STYLE so default fontsize returns null value.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-03-04
  • Updated: 2010-04-02
  • Resolved: 2006-03-30
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 b78Fixed
Related Reports
Relates :  
Description
Bug Info:
=========
Size key is missing in StyleContext.DEFAULT_STYLE so when trying to get the default font size of textpane returns null value instead of numeric.It is regression from mustang b71 onwards.

Please find the attached java file.

Expected Results:
=================
It should returns default font size value.

Actual Results:
===============
It has return null value.

Comments
EVALUATION This bug is a regression introduced by the fix for 6366440 [Application deadlocks when printing some text through JTextPane] After that fix we started to check whether we need to set attributes for style. The logic is we set attribute if the current value is different for the new one. The problem is we used StyleConstants.getFoo to get the current value of attributes. StyleConstants returns some default values in case attribute is not define. In case the default value is the same as the one we want to set the attribute to the attribute will not be set. In the case of this bug FontSize attribute is not initialized because StyleConstants.getFontSize returns 12 in case this attribute is not defined and FontSize we want to initialize style with happened to be 12 too. We need to fetch attributes directly from style instead of using StyleConstants.getFoo for that.
16-03-2006