8224915: Better serial attributes
Reviewed-by: serb, psadhukhan, mschoene, rhalade
--- 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