void (MavenProject aggregator, MavenProject project, UpdateContext updateContext) { for (MavenProject each : getModules(project)) { if (isManagedFile(each.getPath())) { if (reconnectRoot(each)) { updateContext.updated(each, MavenProjectChanges.NONE); } } else { doDelete(project, each, updateContext); } } withWriteLock(() -> { if (aggregator != null) { removeModule(aggregator, project); } else { myRootProjects.remove(project); } myTimestamps.remove(project.getFile()); myVirtualFileToProjectMapping.remove(project.getFile()); clearIDMaps(project.getMavenId()); myAggregatorToModuleMapping.remove(project); myModuleToAggregatorMapping.remove(project); }); updateContext.deleted(project); }