diff --git a/idea/src/org/jetbrains/jet/plugin/project/AnalyzerFacadeWithCache.java b/idea/src/org/jetbrains/jet/plugin/project/AnalyzerFacadeWithCache.java index 335b7cef929..27c02d7acb5 100644 --- a/idea/src/org/jetbrains/jet/plugin/project/AnalyzerFacadeWithCache.java +++ b/idea/src/org/jetbrains/jet/plugin/project/AnalyzerFacadeWithCache.java @@ -76,9 +76,9 @@ public final class AnalyzerFacadeWithCache { @NotNull final Function> declarationProvider) { // Need lock for getValue(), because parallel threads can start evaluation of compute() simultaneously synchronized (lock) { - CachedValue bindingContextCachedValue = file.getUserData(ANALYZE_EXHAUST_FULL); - if (bindingContextCachedValue == null) { - bindingContextCachedValue = + CachedValue result = file.getUserData(ANALYZE_EXHAUST_FULL); + if (result == null) { + result = CachedValuesManager.getManager(file.getProject()).createCachedValue(new CachedValueProvider() { @Override public Result compute() { @@ -107,10 +107,10 @@ public final class AnalyzerFacadeWithCache { } }, false); - file.putUserData(ANALYZE_EXHAUST_FULL, bindingContextCachedValue); + file.putUserData(ANALYZE_EXHAUST_FULL, result); } - return bindingContextCachedValue.getValue(); + return result.getValue(); } } @@ -150,13 +150,13 @@ public final class AnalyzerFacadeWithCache { // Need to resolve bodies in given file and all in the same package return AnalyzerFacadeProvider.getAnalyzerFacadeForFile(file).analyzeBodiesInFiles( - file.getProject(), - Collections.emptyList(), - new JetFilesProvider.SameJetFilePredicate(file), - new DelegatingBindingTrace(analyzeExhaustHeaders.getBindingContext(), - "trace to resolve bodies in file", file.getName()), - context, - moduleConfiguration); + file.getProject(), + Collections.emptyList(), + new JetFilesProvider.SameJetFilePredicate(file), + new DelegatingBindingTrace(analyzeExhaustHeaders.getBindingContext(), + "trace to resolve bodies in file", file.getName()), + context, + moduleConfiguration); } @NotNull