1.1 --- a/emul/compact/src/main/java/java/util/HashSet.java Wed Jan 23 22:32:27 2013 +0100
1.2 +++ b/emul/compact/src/main/java/java/util/HashSet.java Wed Jan 23 22:55:28 2013 +0100
1.3 @@ -257,56 +257,4 @@
1.4 }
1.5 }
1.6
1.7 - /**
1.8 - * Save the state of this <tt>HashSet</tt> instance to a stream (that is,
1.9 - * serialize it).
1.10 - *
1.11 - * @serialData The capacity of the backing <tt>HashMap</tt> instance
1.12 - * (int), and its load factor (float) are emitted, followed by
1.13 - * the size of the set (the number of elements it contains)
1.14 - * (int), followed by all of its elements (each an Object) in
1.15 - * no particular order.
1.16 - */
1.17 - private void writeObject(java.io.ObjectOutputStream s)
1.18 - throws java.io.IOException {
1.19 - // Write out any hidden serialization magic
1.20 - s.defaultWriteObject();
1.21 -
1.22 - // Write out HashMap capacity and load factor
1.23 - s.writeInt(map.capacity());
1.24 - s.writeFloat(map.loadFactor());
1.25 -
1.26 - // Write out size
1.27 - s.writeInt(map.size());
1.28 -
1.29 - // Write out all elements in the proper order.
1.30 - for (E e : map.keySet())
1.31 - s.writeObject(e);
1.32 - }
1.33 -
1.34 - /**
1.35 - * Reconstitute the <tt>HashSet</tt> instance from a stream (that is,
1.36 - * deserialize it).
1.37 - */
1.38 - private void readObject(java.io.ObjectInputStream s)
1.39 - throws java.io.IOException, ClassNotFoundException {
1.40 - // Read in any hidden serialization magic
1.41 - s.defaultReadObject();
1.42 -
1.43 - // Read in HashMap capacity and load factor and create backing HashMap
1.44 - int capacity = s.readInt();
1.45 - float loadFactor = s.readFloat();
1.46 - map = (((HashSet)this) instanceof LinkedHashSet ?
1.47 - new LinkedHashMap<E,Object>(capacity, loadFactor) :
1.48 - new HashMap<E,Object>(capacity, loadFactor));
1.49 -
1.50 - // Read in size
1.51 - int size = s.readInt();
1.52 -
1.53 - // Read in all elements in the proper order.
1.54 - for (int i=0; i<size; i++) {
1.55 - E e = (E) s.readObject();
1.56 - map.put(e, PRESENT);
1.57 - }
1.58 - }
1.59 }