Unused methods removed, class renamed

This commit is contained in:
Andrey Breslav
2013-03-27 19:39:11 +04:00
parent fb4a205277
commit 83e2986a7b
4 changed files with 6 additions and 30 deletions
@@ -77,7 +77,7 @@ public class KotlinCacheManager {
Predicates.<PsiFile>alwaysFalse()
);
return Result.<KotlinDeclarationsCache>create(
new AnalyzeExhaustAsKotlinDeclarationsCache(analyzeExhaust),
new KotlinDeclarationsCacheImpl(analyzeExhaust),
PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT
);
}
@@ -17,18 +17,9 @@
package org.jetbrains.jet.plugin.caches.resolve;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.ModuleConfiguration;
import org.jetbrains.jet.lang.resolve.BindingContext;
import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
public interface KotlinDeclarationsCache {
@NotNull
BindingContext getBindingContext();
@Nullable
BodiesResolveContext getBodiesResolveContext();
@NotNull @Deprecated // ModuleConfiguration must be obtained from the module
ModuleConfiguration getModuleConfiguration();
}
@@ -18,43 +18,28 @@ package org.jetbrains.jet.plugin.caches.resolve;
import com.intellij.openapi.diagnostic.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
import org.jetbrains.jet.lang.ModuleConfiguration;
import org.jetbrains.jet.lang.resolve.BindingContext;
import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
public class AnalyzeExhaustAsKotlinDeclarationsCache implements KotlinDeclarationsCache {
public class KotlinDeclarationsCacheImpl implements KotlinDeclarationsCache {
private static final Logger LOG = Logger.getInstance(AnalyzeExhaustAsKotlinDeclarationsCache.class);
private static final Logger LOG = Logger.getInstance(KotlinDeclarationsCacheImpl.class);
private final AnalyzeExhaust exhaust;
public AnalyzeExhaustAsKotlinDeclarationsCache(@NotNull AnalyzeExhaust exhaust) {
public KotlinDeclarationsCacheImpl(@NotNull AnalyzeExhaust exhaust) {
this.exhaust = exhaust;
if (exhaust.isError()) {
LOG.error(exhaust.getError());
}
}
@Nullable
@Override
public BodiesResolveContext getBodiesResolveContext() {
return exhaust.getBodiesResolveContext();
}
@Override
@NotNull
public BindingContext getBindingContext() {
return exhaust.getBindingContext();
}
@Override
@NotNull
public ModuleConfiguration getModuleConfiguration() {
return exhaust.getModuleConfiguration();
}
@NotNull
public AnalyzeExhaust getAnalyzeExhaust() {
return exhaust;
@@ -40,7 +40,7 @@ import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.resolve.*;
import org.jetbrains.jet.lang.resolve.java.JetFilesProvider;
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
import org.jetbrains.jet.plugin.caches.resolve.AnalyzeExhaustAsKotlinDeclarationsCache;
import org.jetbrains.jet.plugin.caches.resolve.KotlinDeclarationsCacheImpl;
import org.jetbrains.jet.plugin.caches.resolve.KotlinCacheManager;
import org.jetbrains.jet.plugin.caches.resolve.KotlinDeclarationsCache;
import org.jetbrains.jet.plugin.util.ApplicationUtils;
@@ -120,7 +120,7 @@ public final class AnalyzerFacadeWithCache {
private static AnalyzeExhaust analyzeHeadersWithCacheOnFile(@NotNull JetFile fileToCache) {
KotlinDeclarationsCache cache = KotlinCacheManager.getInstance(fileToCache.getProject()).getDeclarationsFromProject();
return ((AnalyzeExhaustAsKotlinDeclarationsCache) cache).getAnalyzeExhaust();
return ((KotlinDeclarationsCacheImpl) cache).getAnalyzeExhaust();
}
private static AnalyzeExhaust analyzeBodies(AnalyzeExhaust analyzeExhaustHeaders, JetFile file) {