Unused code removed
This commit is contained in:
+1
-1
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user