8224915: Better serial attributes
authorprr
Fri, 14 Jun 2019 20:33:17 -0700
changeset 58632 fbab568169c4
parent 58631 36c5e85b8597
child 58633 0c518cbf1dcc
8224915: Better serial attributes Reviewed-by: serb, psadhukhan, mschoene, rhalade
src/java.desktop/share/classes/java/awt/Font.java
--- a/src/java.desktop/share/classes/java/awt/Font.java	Tue Jun 25 00:07:47 2019 +0100
+++ b/src/java.desktop/share/classes/java/awt/Font.java	Fri Jun 14 20:33:17 2019 -0700
@@ -1929,6 +1929,7 @@
         // value is the default.
 
         if (fRequestedAttributes != null) {
+            try {
             values = getAttributeValues(); // init
             AttributeValues extras =
                 AttributeValues.fromSerializableHashtable(fRequestedAttributes);
@@ -1938,10 +1939,13 @@
             values = getAttributeValues().merge(extras);
             this.nonIdentityTx = values.anyNonDefault(EXTRA_MASK);
             this.hasLayoutAttributes =  values.anyNonDefault(LAYOUT_MASK);
-
+            } catch (Throwable t) {
+                throw new IOException(t);
+            } finally {
             fRequestedAttributes = null; // don't need it any more
         }
     }
+    }
 
     /**
      * Returns the number of glyphs in this {@code Font}. Glyph codes