newMap.put(items[i].getKey(), items[i]); newNames.put(((Collection) items[i]).getURI().getRawCollectionPath(), items[i].getKey());
if (items[i] != null) { newMap.put(items[i].getKey(), items[i]); newNames.put(((Collection) items[i]).getURI().getRawCollectionPath(), items[i].getKey()); }
    public void resize(int newSize) {        if (newSize < size) {            shrink(newSize);            names = new Object2LongHashMap(newSize);        } else {            LOG.debug("Growing cache from " + size + " to " + newSize);            Cacheable[] newItems = new Cacheable[newSize];            Long2ObjectHashMap newMap = new Long2ObjectHashMap(newSize);            Object2LongHashMap newNames = new Object2LongHashMap(newSize);            for (int i = 0; i < count; i++) {                newItems[i] = items[i];                newMap.put(items[i].getKey(), items[i]);                newNames.put(((Collection) items[i]).getURI().getRawCollectionPath(), items[i].getKey());            }            this.size = newSize;            this.map = newMap;            this.names = newNames;            this.items = newItems;            accounting.reset();            accounting.setTotalSize(size);        }    }