--- a/jdk/src/share/classes/javax/swing/text/html/HRuleView.java Sat Aug 30 17:29:59 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/text/html/HRuleView.java Mon Sep 01 15:21:46 2008 +0400
@@ -67,13 +67,18 @@
// use ALIGN_CENTER by default, so we check if the alignment
// attribute is actually defined
if (attr.getAttribute(StyleConstants.Alignment) != null) {
- alignment = StyleConstants.getAlignment(attr);
+ alignment = StyleConstants.getAlignment(attr);
}
noshade = (String)eAttr.getAttribute(HTML.Attribute.NOSHADE);
Object value = eAttr.getAttribute(HTML.Attribute.SIZE);
- if (value != null && (value instanceof String))
- size = Integer.parseInt((String)value);
+ if (value != null && (value instanceof String)) {
+ try {
+ size = Integer.parseInt((String)value);
+ } catch (NumberFormatException e) {
+ size = 1;
+ }
+ }
value = attr.getAttribute(CSS.Attribute.WIDTH);
if (value != null && (value instanceof CSS.LengthValue)) {
widthValue = (CSS.LengthValue)value;