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() Predicates.<PsiFile>alwaysFalse()
); );
return Result.<KotlinDeclarationsCache>create( return Result.<KotlinDeclarationsCache>create(
new AnalyzeExhaustAsKotlinDeclarationsCache(analyzeExhaust), new KotlinDeclarationsCacheImpl(analyzeExhaust),
PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT
); );
} }
@@ -17,18 +17,9 @@
package org.jetbrains.jet.plugin.caches.resolve; package org.jetbrains.jet.plugin.caches.resolve;
import org.jetbrains.annotations.NotNull; 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.BindingContext;
import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
public interface KotlinDeclarationsCache { public interface KotlinDeclarationsCache {
@NotNull @NotNull
BindingContext getBindingContext(); 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 com.intellij.openapi.diagnostic.Logger;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.analyzer.AnalyzeExhaust; 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.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; private final AnalyzeExhaust exhaust;
public AnalyzeExhaustAsKotlinDeclarationsCache(@NotNull AnalyzeExhaust exhaust) { public KotlinDeclarationsCacheImpl(@NotNull AnalyzeExhaust exhaust) {
this.exhaust = exhaust; this.exhaust = exhaust;
if (exhaust.isError()) { if (exhaust.isError()) {
LOG.error(exhaust.getError()); LOG.error(exhaust.getError());
} }
} }
@Nullable
@Override
public BodiesResolveContext getBodiesResolveContext() {
return exhaust.getBodiesResolveContext();
}
@Override @Override
@NotNull @NotNull
public BindingContext getBindingContext() { public BindingContext getBindingContext() {
return exhaust.getBindingContext(); return exhaust.getBindingContext();
} }
@Override
@NotNull
public ModuleConfiguration getModuleConfiguration() {
return exhaust.getModuleConfiguration();
}
@NotNull @NotNull
public AnalyzeExhaust getAnalyzeExhaust() { public AnalyzeExhaust getAnalyzeExhaust() {
return exhaust; 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.*;
import org.jetbrains.jet.lang.resolve.java.JetFilesProvider; import org.jetbrains.jet.lang.resolve.java.JetFilesProvider;
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession; 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.KotlinCacheManager;
import org.jetbrains.jet.plugin.caches.resolve.KotlinDeclarationsCache; import org.jetbrains.jet.plugin.caches.resolve.KotlinDeclarationsCache;
import org.jetbrains.jet.plugin.util.ApplicationUtils; import org.jetbrains.jet.plugin.util.ApplicationUtils;
@@ -120,7 +120,7 @@ public final class AnalyzerFacadeWithCache {
private static AnalyzeExhaust analyzeHeadersWithCacheOnFile(@NotNull JetFile fileToCache) { private static AnalyzeExhaust analyzeHeadersWithCacheOnFile(@NotNull JetFile fileToCache) {
KotlinDeclarationsCache cache = KotlinCacheManager.getInstance(fileToCache.getProject()).getDeclarationsFromProject(); KotlinDeclarationsCache cache = KotlinCacheManager.getInstance(fileToCache.getProject()).getDeclarationsFromProject();
return ((AnalyzeExhaustAsKotlinDeclarationsCache) cache).getAnalyzeExhaust(); return ((KotlinDeclarationsCacheImpl) cache).getAnalyzeExhaust();
} }
private static AnalyzeExhaust analyzeBodies(AnalyzeExhaust analyzeExhaustHeaders, JetFile file) { private static AnalyzeExhaust analyzeBodies(AnalyzeExhaust analyzeExhaustHeaders, JetFile file) {