/** * Sets a key/value. */ public void put(String key, Serializable value) { if (value == null) { // if we're using a ConcurrentHashMap // then null values are forbidden // this is ok given our semantics of null vs absent key if (map != null) { map.remove(key); } else { int i = keys.indexOf(key); if (i >= 0) { // cost is not trivial but we don't use this often, if at all keys.remove(i); values.remove(i); } } } else { putEvenIfNull(key, value); } }