diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspection.java b/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspection.java index e671bab73b80..e934962bbe28 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspection.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspection.java @@ -115,8 +115,9 @@ public class SSBasedInspection extends LocalInspectionTool { synchronized (LOCK) { if (LexicalNodesFilter.getInstance().accepts(element)) return; final SsrFilteringNodeIterator matchedNodes = new SsrFilteringNodeIterator(element); - for (Configuration configuration : myConfigurations) { - final MatchContext context = compiledOptions.get(configuration); + for (Map.Entry entry : compiledOptions.entrySet()) { + Configuration configuration = entry.getKey(); + MatchContext context = entry.getValue(); if (MatcherImpl.checkIfShouldAttemptToMatch(context, matchedNodes)) { final int nodeCount = context.getPattern().getNodeCount(); diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionCompiledPatternsCache.java b/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionCompiledPatternsCache.java index f8add2370037..173a51e9d4d2 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionCompiledPatternsCache.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/inspection/highlightTemplate/SSBasedInspectionCompiledPatternsCache.java @@ -11,6 +11,8 @@ import org.jetbrains.annotations.NotNull; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** * @author Eugene.Kudelevsky @@ -28,7 +30,8 @@ public class SSBasedInspectionCompiledPatternsCache { matcher.precompileOptions(configurations, cache); project.putUserData(COMPILED_OPTIONS_KEY, cache); } - return cache; + + return configurations.stream().collect(Collectors.toMap(Function.identity(), cache::get)); } private static boolean areConfigurationsInCache(@NotNull List configurations,