From 8fc46680d6026bb886bb59f9756fb7476e438980 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Mon, 12 Nov 2012 11:55:19 +0400 Subject: [PATCH] Usinf io.File instead of concatenating paths --- .../jetbrains/jet/plugin/compiler/K2JSCompiler.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/compiler/K2JSCompiler.java b/idea/src/org/jetbrains/jet/plugin/compiler/K2JSCompiler.java index 2e58c4ad048..7358269dec6 100644 --- a/idea/src/org/jetbrains/jet/plugin/compiler/K2JSCompiler.java +++ b/idea/src/org/jetbrains/jet/plugin/compiler/K2JSCompiler.java @@ -129,7 +129,7 @@ public final class K2JSCompiler implements TranslatingCompiler { private static Integer doExec(@NotNull MessageCollector messageCollector, @NotNull CompilerEnvironment environment, @NotNull PrintStream out, @NotNull Module module) throws Exception { File outDir = environment.getOutput(); - String outFile = outDir.getPath() + "/" + module.getName() + ".js"; + File outFile = new File(outDir, module.getName() + ".js"); String[] commandLineArgs = constructArguments(module, outFile); Object rc = invokeExecMethod(environment, out, messageCollector, commandLineArgs, "org.jetbrains.jet.cli.js.K2JSCompiler"); @@ -142,7 +142,7 @@ public final class K2JSCompiler implements TranslatingCompiler { } @NotNull - private static String[] constructArguments(@NotNull Module module, @Nullable String outFile) { + private static String[] constructArguments(@NotNull Module module, @NotNull File outFile) { VirtualFile[] sourceFiles = getSourceFiles(module); ArrayList args = Lists.newArrayList("-tags", "-verbose", "-version"); @@ -234,11 +234,9 @@ public final class K2JSCompiler implements TranslatingCompiler { } } - private static void addOutputPath(@Nullable String outFile, @NotNull ArrayList args) { - if (outFile != null) { - args.add("-output"); - args.add(outFile); - } + private static void addOutputPath(@NotNull File outFile, @NotNull ArrayList args) { + args.add("-output"); + args.add(outFile.getPath()); } @NotNull