1.1 --- a/emul/compact/src/main/java/java/util/HashMap.java Wed Jan 23 22:32:27 2013 +0100
1.2 +++ b/emul/compact/src/main/java/java/util/HashMap.java Mon Feb 25 19:00:08 2013 +0100
1.3 @@ -980,70 +980,9 @@
1.4 }
1.5 }
1.6
1.7 - /**
1.8 - * Save the state of the <tt>HashMap</tt> instance to a stream (i.e.,
1.9 - * serialize it).
1.10 - *
1.11 - * @serialData The <i>capacity</i> of the HashMap (the length of the
1.12 - * bucket array) is emitted (int), followed by the
1.13 - * <i>size</i> (an int, the number of key-value
1.14 - * mappings), followed by the key (Object) and value (Object)
1.15 - * for each key-value mapping. The key-value mappings are
1.16 - * emitted in no particular order.
1.17 - */
1.18 - private void writeObject(java.io.ObjectOutputStream s)
1.19 - throws IOException
1.20 - {
1.21 - Iterator<Map.Entry<K,V>> i =
1.22 - (size > 0) ? entrySet0().iterator() : null;
1.23 -
1.24 - // Write out the threshold, loadfactor, and any hidden stuff
1.25 - s.defaultWriteObject();
1.26 -
1.27 - // Write out number of buckets
1.28 - s.writeInt(table.length);
1.29 -
1.30 - // Write out size (number of Mappings)
1.31 - s.writeInt(size);
1.32 -
1.33 - // Write out keys and values (alternating)
1.34 - if (i != null) {
1.35 - while (i.hasNext()) {
1.36 - Map.Entry<K,V> e = i.next();
1.37 - s.writeObject(e.getKey());
1.38 - s.writeObject(e.getValue());
1.39 - }
1.40 - }
1.41 - }
1.42
1.43 private static final long serialVersionUID = 362498820763181265L;
1.44
1.45 - /**
1.46 - * Reconstitute the <tt>HashMap</tt> instance from a stream (i.e.,
1.47 - * deserialize it).
1.48 - */
1.49 - private void readObject(java.io.ObjectInputStream s)
1.50 - throws IOException, ClassNotFoundException
1.51 - {
1.52 - // Read in the threshold, loadfactor, and any hidden stuff
1.53 - s.defaultReadObject();
1.54 -
1.55 - // Read in number of buckets and allocate the bucket array;
1.56 - int numBuckets = s.readInt();
1.57 - table = new Entry[numBuckets];
1.58 -
1.59 - init(); // Give subclass a chance to do its thing.
1.60 -
1.61 - // Read in size (number of Mappings)
1.62 - int size = s.readInt();
1.63 -
1.64 - // Read the keys and values, and put the mappings in the HashMap
1.65 - for (int i=0; i<size; i++) {
1.66 - K key = (K) s.readObject();
1.67 - V value = (V) s.readObject();
1.68 - putForCreate(key, value);
1.69 - }
1.70 - }
1.71
1.72 // These methods are used when serializing HashSets
1.73 int capacity() { return table.length; }