Refactoring: drop method, rename method in TopDownAnalyzerFacadeForJVM.java

This commit is contained in:
Nikolay Krasko
2014-11-28 13:55:47 +03:00
parent 840e16baa0
commit e49d13dfac
6 changed files with 15 additions and 26 deletions
@@ -42,6 +42,7 @@ import org.jetbrains.jet.codegen.*;
import org.jetbrains.jet.codegen.state.GenerationState;
import org.jetbrains.jet.codegen.state.Progress;
import org.jetbrains.jet.config.CompilerConfiguration;
import org.jetbrains.jet.context.ContextPackage;
import org.jetbrains.jet.lang.descriptors.impl.ModuleDescriptorImpl;
import org.jetbrains.jet.lang.parsing.JetScriptDefinition;
import org.jetbrains.jet.lang.parsing.JetScriptDefinitionProvider;
@@ -62,7 +63,9 @@ import org.jetbrains.jet.utils.KotlinPaths;
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.*;
import java.util.Collection;
import java.util.List;
import java.util.Map;
public class KotlinToJVMBytecodeCompiler {
@@ -294,8 +297,9 @@ public class KotlinToJVMBytecodeCompiler {
BindingTrace sharedTrace = new CliLightClassGenerationSupport.NoScopeRecordCliBindingTrace();
ModuleDescriptorImpl analyzeModule = TopDownAnalyzerFacadeForJVM.createSealedJavaModule();
return TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
return TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationWithCustomContext(
environment.getProject(),
ContextPackage.GlobalContext(),
environment.getSourceFiles(),
sharedTrace,
Predicates.<PsiFile>alwaysTrue(),
@@ -62,7 +62,7 @@ public enum TopDownAnalyzerFacadeForJVM {
}
@NotNull
public static AnalysisResult analyzeFilesWithJavaIntegration(
public static AnalysisResult analyzeFilesWithJavaIntegrationNoIncremental(
@NotNull Project project,
@NotNull Collection<JetFile> files,
@NotNull BindingTrace trace,
@@ -72,22 +72,6 @@ public enum TopDownAnalyzerFacadeForJVM {
return analyzeFilesWithJavaIntegration(project, files, trace, topDownAnalysisParameters, module, null, null);
}
@NotNull
public static AnalysisResult analyzeFilesWithJavaIntegration(
@NotNull Project project,
@NotNull Collection<JetFile> files,
@NotNull BindingTrace trace,
@NotNull Predicate<PsiFile> filesToAnalyzeCompletely,
@NotNull ModuleDescriptorImpl module,
@Nullable List<String> moduleIds,
@Nullable IncrementalCacheProvider incrementalCacheProvider
) {
return analyzeFilesWithJavaIntegrationWithCustomContext(
project, ContextPackage.GlobalContext(), files, trace,
filesToAnalyzeCompletely, module, moduleIds,
incrementalCacheProvider);
}
@NotNull
public static AnalysisResult analyzeFilesWithJavaIntegrationWithCustomContext(
@NotNull Project project,
@@ -156,7 +156,7 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir {
false
);
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationNoIncremental(
environment.getProject(),
environment.getSourceFiles(),
trace,
@@ -23,11 +23,11 @@ import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.analyzer.AnalysisResult;
import org.jetbrains.jet.cli.jvm.compiler.CliLightClassGenerationSupport;
import org.jetbrains.jet.context.ContextPackage;
import org.jetbrains.jet.lang.descriptors.impl.ModuleDescriptorImpl;
import org.jetbrains.jet.lang.psi.JetFile;
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
import org.jetbrains.jet.lang.resolve.BindingTrace;
import org.jetbrains.jet.lang.resolve.BindingTraceContext;
import org.jetbrains.jet.lang.resolve.java.TopDownAnalyzerFacadeForJVM;
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
@@ -82,7 +82,7 @@ public class JvmResolveUtil {
BindingTrace trace = new CliLightClassGenerationSupport.CliBindingTrace();
return TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
project, files, trace, filesToAnalyzeCompletely, module, null, null);
return TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationWithCustomContext(
project, ContextPackage.GlobalContext(), files, trace, filesToAnalyzeCompletely, module, null, null);
}
}
@@ -56,7 +56,7 @@ public class LazyResolveTestUtil {
BindingTrace trace = new CliLightClassGenerationSupport.NoScopeRecordCliBindingTrace();
ModuleDescriptorImpl sharedModule = TopDownAnalyzerFacadeForJVM.createSealedJavaModule();
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationNoIncremental(
environment.getProject(),
files,
trace,
@@ -34,6 +34,7 @@ import org.jetbrains.jet.lang.resolve.BindingTraceContext
import org.jetbrains.jet.lang.resolve.name.ClassId
import org.jetbrains.jet.lang.resolve.MemberComparator
import org.jetbrains.jet.lang.resolve.descriptorUtil.module
import org.jetbrains.jet.context.GlobalContext
public class DecompiledTextConsistencyTest : JetLightCodeInsightFixtureTestCase() {
@@ -63,8 +64,8 @@ class ProjectBasedResolverForDecompiler(project: Project) : ResolverForDecompile
module.addDependencyOnModule(module)
module.addDependencyOnModule(KotlinBuiltIns.getInstance().getBuiltInsModule())
module.seal()
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
project, listOf(), BindingTraceContext(), { false },
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationWithCustomContext(
project, GlobalContext(), listOf(), BindingTraceContext(), { false },
module, null, null
).moduleDescriptor
}