From db00500404e4862548ed5eb49f7289e1e8eba99c Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Tue, 29 Apr 2014 19:50:34 +0400 Subject: [PATCH] Unused code removed --- .../resolve/java/AnalyzerFacadeForJVM.java | 2 +- .../jet/analyzer/AnalyzeExhaust.java | 22 +------- .../resolve/KotlinDeclarationsCache.java | 25 --------- .../resolve/KotlinDeclarationsCacheImpl.java | 56 ------------------- .../caches/resolve/KotlinResolveCache.kt | 3 +- .../k2js/analyze/AnalyzerFacadeForJS.java | 2 +- 6 files changed, 6 insertions(+), 104 deletions(-) delete mode 100644 idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinDeclarationsCache.java delete mode 100644 idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinDeclarationsCacheImpl.java diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/AnalyzerFacadeForJVM.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/AnalyzerFacadeForJVM.java index a71d0f2e1f2..5e4025e4925 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/AnalyzerFacadeForJVM.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/AnalyzerFacadeForJVM.java @@ -142,7 +142,7 @@ public enum AnalyzerFacadeForJVM implements AnalyzerFacade { BodiesResolveContext bodiesResolveContext = storeContextForBodiesResolve ? new CachedBodiesResolveContext(topDownAnalysisContext) : null; - return AnalyzeExhaust.success(trace.getBindingContext(), bodiesResolveContext, module); + return AnalyzeExhaust.success(trace.getBindingContext(), module); } finally { injector.destroy(); diff --git a/compiler/frontend/src/org/jetbrains/jet/analyzer/AnalyzeExhaust.java b/compiler/frontend/src/org/jetbrains/jet/analyzer/AnalyzeExhaust.java index 1ef876a6617..1e1f7aa5444 100644 --- a/compiler/frontend/src/org/jetbrains/jet/analyzer/AnalyzeExhaust.java +++ b/compiler/frontend/src/org/jetbrains/jet/analyzer/AnalyzeExhaust.java @@ -20,51 +20,35 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.ModuleDescriptor; import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.BodiesResolveContext; import org.jetbrains.jet.lang.types.ErrorUtils; public class AnalyzeExhaust { public static final AnalyzeExhaust EMPTY = success(BindingContext.EMPTY, ErrorUtils.getErrorModule()); - public static AnalyzeExhaust success(@NotNull BindingContext bindingContext, @NotNull ModuleDescriptor module) { - return new AnalyzeExhaust(bindingContext, module, null, null); - } - @NotNull - public static AnalyzeExhaust success(@NotNull BindingContext bindingContext, - @Nullable BodiesResolveContext bodiesResolveContext, - @NotNull ModuleDescriptor module - ) { - return new AnalyzeExhaust(bindingContext, module, bodiesResolveContext, null); + public static AnalyzeExhaust success(@NotNull BindingContext bindingContext, @NotNull ModuleDescriptor module) { + return new AnalyzeExhaust(bindingContext, module, null); } @NotNull public static AnalyzeExhaust error(@NotNull BindingContext bindingContext, @NotNull Throwable error) { - return new AnalyzeExhaust(bindingContext, ErrorUtils.getErrorModule(), null, error); + return new AnalyzeExhaust(bindingContext, ErrorUtils.getErrorModule(), error); } private final BindingContext bindingContext; private final Throwable error; - private final BodiesResolveContext bodiesResolveContext; private final ModuleDescriptor moduleDescriptor; private AnalyzeExhaust( @NotNull BindingContext bindingContext, @NotNull ModuleDescriptor moduleDescriptor, - @Nullable BodiesResolveContext bodiesResolveContext, @Nullable Throwable error ) { this.bindingContext = bindingContext; this.error = error; - this.bodiesResolveContext = bodiesResolveContext; this.moduleDescriptor = moduleDescriptor; } - @Nullable - public BodiesResolveContext getBodiesResolveContext() { - return bodiesResolveContext; - } - @NotNull public BindingContext getBindingContext() { return bindingContext; diff --git a/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinDeclarationsCache.java b/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinDeclarationsCache.java deleted file mode 100644 index 23c3d2b388b..00000000000 --- a/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinDeclarationsCache.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.plugin.caches.resolve; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.resolve.BindingContext; - -public interface KotlinDeclarationsCache { - @NotNull - BindingContext getBindingContext(); -} diff --git a/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinDeclarationsCacheImpl.java b/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinDeclarationsCacheImpl.java deleted file mode 100644 index 9c4af39442d..00000000000 --- a/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinDeclarationsCacheImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.plugin.caches.resolve; - -import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.util.ModificationTracker; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.analyzer.AnalyzeExhaust; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.BodiesResolveContext; - -public class KotlinDeclarationsCacheImpl implements KotlinDeclarationsCache, ModificationTracker { - - private static final Logger LOG = Logger.getInstance(KotlinDeclarationsCacheImpl.class); - - private final AnalyzeExhaust exhaust; - - public KotlinDeclarationsCacheImpl(@NotNull AnalyzeExhaust exhaust) { - this.exhaust = exhaust; - if (exhaust.isError()) { - LOG.error(exhaust.getError()); - } - } - - @Override - @NotNull - public BindingContext getBindingContext() { - return exhaust.getBindingContext(); - } - - @Override - public long getModificationCount() { - BodiesResolveContext context = exhaust.getBodiesResolveContext(); - if (context == null) return 0; - return context.getExceptionTracker().getModificationCount(); - } - - @NotNull - public AnalyzeExhaust getAnalyzeExhaust() { - return exhaust; - } -} diff --git a/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinResolveCache.kt b/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinResolveCache.kt index 8d82252a85a..719f2203081 100644 --- a/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinResolveCache.kt +++ b/idea/src/org/jetbrains/jet/plugin/caches/resolve/KotlinResolveCache.kt @@ -232,7 +232,7 @@ private class KotlinResolveCache( resolveSession.getModuleDescriptor(), MemberFilter.ALWAYS_TRUE ) - val resultingContext = injector.getLazyTopDownAnalyzer()!!.analyzeDeclarations( + injector.getLazyTopDownAnalyzer()!!.analyzeDeclarations( resolveSession, TopDownAnalysisParameters.createForLazy( resolveSession.getStorageManager(), @@ -245,7 +245,6 @@ private class KotlinResolveCache( ) return AnalyzeExhaust.success( trace.getBindingContext(), - resultingContext, resolveSession.getModuleDescriptor() ) } diff --git a/js/js.translator/src/org/jetbrains/k2js/analyze/AnalyzerFacadeForJS.java b/js/js.translator/src/org/jetbrains/k2js/analyze/AnalyzerFacadeForJS.java index 46f0df14baa..d8813755bee 100644 --- a/js/js.translator/src/org/jetbrains/k2js/analyze/AnalyzerFacadeForJS.java +++ b/js/js.translator/src/org/jetbrains/k2js/analyze/AnalyzerFacadeForJS.java @@ -112,7 +112,7 @@ public final class AnalyzerFacadeForJS { BodiesResolveContext bodiesResolveContext = storeContextForBodiesResolve ? new CachedBodiesResolveContext(topDownAnalysisContext) : null; - return AnalyzeExhaust.success(trace.getBindingContext(), bodiesResolveContext, owner); + return AnalyzeExhaust.success(trace.getBindingContext(), owner); } finally { injector.destroy();