void (@NotNull VirtualFile file, @NotNull Object source) { ApplicationManager.getApplication().assertIsNonDispatchThread(); AtomicBoolean isLastExternalSource = new AtomicBoolean(); myProblemsFromExternalSources.compute(file, (__, problems) -> { if (problems == null) return null; problems.remove(source); boolean wasLastProblem = problems.isEmpty(); isLastExternalSource.set(wasLastProblem); return wasLastProblem ? null : problems; }); if (isLastExternalSource.get() && !hasRegularProblems(file)) { fireProblemsDisappeared(file); } else { fireProblemsChanged(file); } }