private void executeDelete(@NotNull VirtualFile file) { if (!file.exists()) { LOG.error("Deleting a file, which does not exist: " + file.getPath()); return; } clearIdCache(); int id = getFileId(file); final VirtualFile parent = file.getParent(); final int parentId = parent == null ? 0 : getFileId(parent); if (parentId == 0) { String rootUrl = normalizeRootUrl(file.getPath(), (NewVirtualFileSystem) file.getFileSystem()); myRootsLock.writeLock().lock(); try { myRoots.remove(rootUrl); myRootsById.remove(id); FSRecords.deleteRootRecord(id); } finally { myRootsLock.writeLock().unlock(); } } else { removeIdFromParentList(parentId, id, parent, file); VirtualDirectoryImpl directory = (VirtualDirectoryImpl) file.getParent(); assert directory != null : file; directory.removeChild(file); } FSRecords.deleteRecordRecursively(id); invalidateSubtree(file); }
private void processResponse(int requestId, R response) { synchronized (myLock) { myTimeoutHandlers.remove(requestId); } final AbstractResponseToRequestHandler handler; synchronized (myLock) { handler = myHandlers.remove(requestId); if (handler == null) return; } //noinspection unchecked if (!handler.processResponse(response)) { synchronized (myLock) { myHandlers.put(requestId, handler); } } }
public synchronized void releaseIndex(int localId) throws MavenServerIndexerException { IndexData data = myDataMap.remove(localId); if (data == null) { MavenLog.LOG.warn("index " + localId + " not found"); return; } // was invalidated on error if (data.remoteId == -1) return; MavenServerIndexer w = getWrappee(); if (w == null) return; try { w.releaseIndex(data.remoteId); } catch (RemoteException e) { handleRemoteError(e); } }
public void removeChild(final int i) { TreeNode child = children.remove(i); child.father = null; // NOPMD }
public void reassignObjectInCacheRead(int key, Object value) { objectsCacheOnRead.remove(key); putObjectInCacheRead(key, value); }
private void removeAllFromMap(int id) { if (id < 0) return; id = unwrap(myFactory.getValue(id)).getID(); myIdToEqClassesIndices.remove(id); }