Collection<String> (@NotNull String reportedPath, boolean isExact) { if (myOptimizedFlatWatchRoots.isEmpty() && myOptimizedRecursiveWatchRoots.isEmpty()) return Collections.emptyList(); var affectedPaths = applyMapping(reportedPath); var changedPaths = new HashSet<String>(); for (var affectedPath : affectedPaths) { if (WatchRootsUtil.isCoveredRecursively(myOptimizedRecursiveWatchRoots, affectedPath) || myOptimizedFlatWatchRoots.contains(affectedPath) || (isExact && myOptimizedFlatWatchRoots.contains(getParentPath(affectedPath)))) { changedPaths.add(affectedPath); } else if (!isExact) { addPrefixedPaths(myOptimizedRecursiveWatchRoots, affectedPath, changedPaths); addPrefixedPaths(myOptimizedFlatWatchRoots, affectedPath, changedPaths); } } return changedPaths; }