void (List<? extends MavenProject> mavenProjects, boolean forUpdate) { synchronized (mySheduledProjects) { for (MavenProject each : mavenProjects) { mySheduledProjects.put(each, forUpdate); } } myUpdateQueue.queue(new Update(MavenShortcutsManager.this) { @Override public void run() { List<MavenProject> projectToUpdate; List<MavenProject> projectToDelete; synchronized (mySheduledProjects) { projectToUpdate = selectScheduledProjects(true); projectToDelete = selectScheduledProjects(false); mySheduledProjects.clear(); } if (!myProject.isDisposed()) { MavenKeymapExtension.clearActions(myProject, projectToDelete); MavenKeymapExtension.updateActions(myProject, projectToUpdate); } } }); }