@Test(expectedExceptions = NullPointerException.class) public void testRemoveNull() { NodeStore nodeStore = new NodeStore(); nodeStore.remove(null); }
@Override public boolean remove(final Object o) { checkNonNullNodeObject(o); NodeImpl node = (NodeImpl) o; int id = node.storeId; if (id != NodeStore.NULL_ID) { checkNodeExists(node); if (viewStore != null) { viewStore.removeNode(node); } node.clearAttributes(); incrementVersion(); int storeIndex = id / GraphStoreConfiguration.NODESTORE_BLOCK_SIZE; NodeBlock block = blocks[storeIndex]; block.remove(node); size--; garbageSize++; dictionary.remove(node.getId()); trimDictionary(); for (int i = storeIndex; i == (blocksCount - 1) && block.garbageLength == block.nodeLength && i >= 0;) { if (i != 0) { blocks[i] = null; blocksCount--; garbageSize -= block.nodeLength; block = blocks[--i]; currentBlock = block; currentBlockIndex--; } else { currentBlock.clear(); garbageSize = 0; break; } } return true; } return false; }
NodeStore implements Collection<Node>, NodeIterable { @Override public boolean remove(final Object o) { checkNonNullNodeObject(o); NodeImpl node = (NodeImpl) o; int id = node.storeId; if (id != NodeStore.NULL_ID) { checkNodeExists(node); if (viewStore != null) { viewStore.removeNode(node); } node.clearAttributes(); incrementVersion(); int storeIndex = id / GraphStoreConfiguration.NODESTORE_BLOCK_SIZE; NodeBlock block = blocks[storeIndex]; block.remove(node); size--; garbageSize++; dictionary.remove(node.getId()); trimDictionary(); for (int i = storeIndex; i == (blocksCount - 1) && block.garbageLength == block.nodeLength && i >= 0;) { if (i != 0) { blocks[i] = null; blocksCount--; garbageSize -= block.nodeLength; block = blocks[--i]; currentBlock = block; currentBlockIndex--; } else { currentBlock.clear(); garbageSize = 0; break; } } return true; } return false; } }
NodeStore implements Collection<Node>, NodeIterable { @Override public boolean remove(final Object o) { checkNonNullNodeObject(o); NodeImpl node = (NodeImpl) o; int id = node.storeId; if (id != NodeStore.NULL_ID) { checkNodeExists(node); if (viewStore != null) { viewStore.removeNode(node); } node.clearAttributes(); incrementVersion(); int storeIndex = id / GraphStoreConfiguration.NODESTORE_BLOCK_SIZE; NodeBlock block = blocks[storeIndex]; block.remove(node); size--; garbageSize++; dictionary.remove(node.getId()); trimDictionary(); for (int i = storeIndex; i == (blocksCount - 1) && block.garbageLength == block.nodeLength && i >= 0;) { if (i != 0) { blocks[i] = null; blocksCount--; garbageSize -= block.nodeLength; block = blocks[--i]; currentBlock = block; currentBlockIndex--; } else { currentBlock.clear(); garbageSize = 0; break; } } return true; } return false; } NodeStore();  NodeStore(final EdgeStore edgeStore, final GraphLock lock, final GraphViewStore viewStore, final GraphVersion graphVersion); }
NodeStore implements Collection<Node>, NodeIterable { @Override public boolean remove(final Object o) { checkNonNullNodeObject(o); NodeImpl node = (NodeImpl) o; int id = node.storeId; if (id != NodeStore.NULL_ID) { checkNodeExists(node); if (viewStore != null) { viewStore.removeNode(node); } node.clearAttributes(); incrementVersion(); int storeIndex = id / GraphStoreConfiguration.NODESTORE_BLOCK_SIZE; NodeBlock block = blocks[storeIndex]; block.remove(node); size--; garbageSize++; dictionary.remove(node.getId()); trimDictionary(); for (int i = storeIndex; i == (blocksCount - 1) && block.garbageLength == block.nodeLength && i >= 0;) { if (i != 0) { blocks[i] = null; blocksCount--; garbageSize -= block.nodeLength; block = blocks[--i]; currentBlock = block; currentBlockIndex--; } else { currentBlock.clear(); garbageSize = 0; break; } } return true; } return false; } NodeStore();  NodeStore(final EdgeStore edgeStore, final GraphLock lock, final GraphViewStore viewStore, final GraphVersion graphVersion); NodeImpl get(final int id); NodeImpl get(final Object id); @Override void clear(); @Override int size(); @Override boolean isEmpty(); @Override NodeStoreIterator iterator(); @Override NodeImpl[] toArray(); @Override T[] toArray(T[] array); @Override Collection<Node> toCollection(); @Override boolean add(final Node n); @Override boolean remove(final Object o); @Override boolean contains(final Object o); boolean containsId(final Object id); @Override boolean containsAll(final Collection<?> c); @Override boolean addAll(final Collection<? extends Node> c); @Override boolean removeAll(final Collection<?> c); @Override boolean retainAll(final Collection<?> c); int deepHashCode(); boolean deepEquals(NodeStore obj); @Override void doBreak(); }
NodeStore implements Collection<Node>, NodeIterable { @Override public boolean remove(final Object o) { checkNonNullNodeObject(o); NodeImpl node = (NodeImpl) o; int id = node.storeId; if (id != NodeStore.NULL_ID) { checkNodeExists(node); if (viewStore != null) { viewStore.removeNode(node); } node.clearAttributes(); incrementVersion(); int storeIndex = id / GraphStoreConfiguration.NODESTORE_BLOCK_SIZE; NodeBlock block = blocks[storeIndex]; block.remove(node); size--; garbageSize++; dictionary.remove(node.getId()); trimDictionary(); for (int i = storeIndex; i == (blocksCount - 1) && block.garbageLength == block.nodeLength && i >= 0;) { if (i != 0) { blocks[i] = null; blocksCount--; garbageSize -= block.nodeLength; block = blocks[--i]; currentBlock = block; currentBlockIndex--; } else { currentBlock.clear(); garbageSize = 0; break; } } return true; } return false; } NodeStore();  NodeStore(final EdgeStore edgeStore, final GraphLock lock, final GraphViewStore viewStore, final GraphVersion graphVersion); NodeImpl get(final int id); NodeImpl get(final Object id); @Override void clear(); @Override int size(); @Override boolean isEmpty(); @Override NodeStoreIterator iterator(); @Override NodeImpl[] toArray(); @Override T[] toArray(T[] array); @Override Collection<Node> toCollection(); @Override boolean add(final Node n); @Override boolean remove(final Object o); @Override boolean contains(final Object o); boolean containsId(final Object id); @Override boolean containsAll(final Collection<?> c); @Override boolean addAll(final Collection<? extends Node> c); @Override boolean removeAll(final Collection<?> c); @Override boolean retainAll(final Collection<?> c); int deepHashCode(); boolean deepEquals(NodeStore obj); @Override void doBreak();  }