resize(); tab = table; index = id & (tab.length - 1);
/** * Associates the specified value with the specified Class in this map. * Returns the previous value associated with key, or <code>null</code> * if there was no mapping for key. */ @SuppressWarnings("unchecked") public synchronized V put(Class key, V value) { final int id; int index; Entry<V>[] tab; Entry<V> e = (tab = table)[index = (id = key.hashCode()) & (tab.length - 1)]; while (e != null) { if (key == e.key) { // identity check // key found, replace V existing = e.value; e.value = value; return existing; } e = e.next; } if (size >= threshold) { resize(); tab = table; index = id & (tab.length - 1); } // creates the new entry tab[index] = new Entry(id, key, value, tab[index]); size++; return null; }