void () { List<ProjectStructureElement> toUpdate = new ArrayList<>(); for (Map.Entry<ProjectStructureElement, ProjectStructureProblemsHolderImpl> entry : myProblemHolders.entrySet()) { if (entry.getValue().containsProblems()) { toUpdate.add(entry.getKey()); } } myProblemHolders.clear(); LOG.debug("Adding to queue updates for " + toUpdate.size() + " problematic elements"); for (ProjectStructureElement element : toUpdate) { queueUpdate(element); } }