/** * Returns a shallow copy of this <tt>HashMap</tt> instance: the keys and values themselves are * not cloned. * * @return a shallow copy of this map */ public Object clone() { HashMap<K, V> result = null; try { result = (HashMap<K, V>) super.clone(); } catch (CloneNotSupportedException e) { // assert false; } result.table = new Entry[table.length]; result.entrySet = null; result.modCount = 0; result.size = 0; result.init(); result.putAllForCreate(this); return result; }