jdk/src/java.desktop/share/classes/javax/swing/text/StyleContext.java
changeset 26037 508779ce6619
parent 26001 991e1be0b235
parent 25859 3317bb8137f4
child 28231 b608ffcaed74
equal deleted inserted replaced
25992:e9b05e933ddd 26037:508779ce6619
   712 
   712 
   713     private void readObject(ObjectInputStream s)
   713     private void readObject(ObjectInputStream s)
   714       throws ClassNotFoundException, IOException
   714       throws ClassNotFoundException, IOException
   715     {
   715     {
   716         fontSearch = new FontKey(null, 0, 0);
   716         fontSearch = new FontKey(null, 0, 0);
   717         fontTable = new Hashtable<FontKey, Font>();
   717         fontTable = new Hashtable<>();
   718         search = new SimpleAttributeSet();
   718         search = new SimpleAttributeSet();
   719         attributesPool = Collections.
   719         attributesPool = Collections.
   720                 synchronizedMap(new WeakHashMap<SmallAttributeSet, WeakReference<SmallAttributeSet>>());
   720                 synchronizedMap(new WeakHashMap<SmallAttributeSet,
   721         s.defaultReadObject();
   721                         WeakReference<SmallAttributeSet>>());
       
   722 
       
   723         ObjectInputStream.GetField f = s.readFields();
       
   724         Style newStyles = (Style) f.get("styles", null);
       
   725         if (newStyles == null) {
       
   726             throw new InvalidObjectException("Null styles");
       
   727         }
       
   728         styles = newStyles;
       
   729         unusedSets = f.get("unusedSets", 0);
   722     }
   730     }
   723 
   731 
   724     // --- variables ---------------------------------------------------
   732     // --- variables ---------------------------------------------------
   725 
   733 
   726     /**
   734     /**
   732     private static Hashtable<Object, String> freezeKeyMap;
   740     private static Hashtable<Object, String> freezeKeyMap;
   733     private static Hashtable<String, Object> thawKeyMap;
   741     private static Hashtable<String, Object> thawKeyMap;
   734 
   742 
   735     private Style styles;
   743     private Style styles;
   736     private transient FontKey fontSearch = new FontKey(null, 0, 0);
   744     private transient FontKey fontSearch = new FontKey(null, 0, 0);
   737     private transient Hashtable<FontKey, Font> fontTable = new Hashtable<FontKey, Font>();
   745     private transient Hashtable<FontKey, Font> fontTable = new Hashtable<>();
   738 
   746 
   739     private transient Map<SmallAttributeSet, WeakReference<SmallAttributeSet>> attributesPool = Collections.
   747     private transient Map<SmallAttributeSet, WeakReference<SmallAttributeSet>> attributesPool = Collections.
   740             synchronizedMap(new WeakHashMap<SmallAttributeSet, WeakReference<SmallAttributeSet>>());
   748             synchronizedMap(new WeakHashMap<SmallAttributeSet, WeakReference<SmallAttributeSet>>());
   741     private transient MutableAttributeSet search = new SimpleAttributeSet();
   749     private transient MutableAttributeSet search = new SimpleAttributeSet();
   742 
   750