From db5faf8300aa799214596f69a0e35475c04913a6 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Tue, 8 Oct 2013 21:46:35 +0400 Subject: [PATCH] CLI: removed unnecessary code that depended on KT-1863 and KT-2498. --- .../jetbrains/jet/cli/common/CLICompiler.java | 4 +--- .../jetbrains/jet/cli/js/K2JSCompiler.java | 6 ++++- .../jetbrains/jet/cli/jvm/K2JVMCompiler.java | 22 +++++-------------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java index 311c018db74..7dbc9797c47 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java @@ -97,7 +97,6 @@ public abstract class CLICompiler { * Strategy method to configure the environment, allowing compiler * based tools to customise their own plugins */ - //TODO: add parameter annotations when KT-1863 is resolved protected void configureEnvironment(@NotNull CompilerConfiguration configuration, @NotNull A arguments) { configuration.addAll(CLIConfigurationKeys.COMPILER_PLUGINS, compilerPlugins); } @@ -158,9 +157,8 @@ public abstract class CLICompiler { } } - //TODO: can't declare parameters as not null due to KT-1863 @NotNull - protected abstract ExitCode doExecute(A arguments, MessageCollector messageCollector, Disposable rootDisposable); + protected abstract ExitCode doExecute(@NotNull A arguments, @NotNull MessageCollector messageCollector, @NotNull Disposable rootDisposable); //TODO: can we make it private? @NotNull diff --git a/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompiler.java index 4c5862cfbb2..571fd626970 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/js/K2JSCompiler.java @@ -67,7 +67,11 @@ public class K2JSCompiler extends CLICompiler { @NotNull @Override - protected ExitCode doExecute(K2JSCompilerArguments arguments, MessageCollector messageCollector, Disposable rootDisposable) { + protected ExitCode doExecute( + @NotNull K2JSCompilerArguments arguments, + @NotNull MessageCollector messageCollector, + @NotNull Disposable rootDisposable + ) { if (arguments.sourceFiles == null) { messageCollector.report(CompilerMessageSeverity.ERROR, "Specify sources location via -sourceFiles", NO_LOCATION); return ExitCode.INTERNAL_ERROR; diff --git a/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompiler.java index 05cf6ad6ee6..85edf64b433 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/jvm/K2JVMCompiler.java @@ -36,7 +36,6 @@ import org.jetbrains.jet.utils.KotlinPathsFromHomeDir; import org.jetbrains.jet.utils.PathUtil; import java.io.File; -import java.io.PrintStream; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -54,7 +53,11 @@ public class K2JVMCompiler extends CLICompiler { @Override @NotNull - protected ExitCode doExecute(K2JVMCompilerArguments arguments, MessageCollector messageCollector, Disposable rootDisposable) { + protected ExitCode doExecute( + @NotNull K2JVMCompilerArguments arguments, + @NotNull MessageCollector messageCollector, + @NotNull Disposable rootDisposable + ) { KotlinPaths paths = arguments.kotlinHome != null ? new KotlinPathsFromHomeDir(new File(arguments.kotlinHome)) : PathUtil.getKotlinPathsForCompiler(); @@ -166,21 +169,6 @@ public class K2JVMCompiler extends CLICompiler { return new K2JVMCompilerArguments(); } - // TODO this method is here only to workaround KT-2498 - @Override - protected void configureEnvironment(@NotNull CompilerConfiguration configuration, @NotNull K2JVMCompilerArguments arguments) { - super.configureEnvironment(configuration, arguments); - } - - //TODO: Hacked! Be sure that our kotlin stuff builds correctly before you remove. - // our compiler throws method not found error - // probably relates to KT-1863... well, may be not - @NotNull - @Override - public ExitCode exec(@NotNull PrintStream errStream, @NotNull K2JVMCompilerArguments arguments) { - return super.exec(errStream, arguments); - } - @NotNull private static List getClasspath(@NotNull KotlinPaths paths, @NotNull K2JVMCompilerArguments arguments) { List classpath = Lists.newArrayList();