From 2ecac63405e119aa825a0014ade6d93d951b4e99 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Thu, 21 Nov 2013 18:39:52 +0400 Subject: [PATCH] Fix compilation error caused by the change in IDEA API --- .../org/jetbrains/jet/cli/CliBaseTest.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java b/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java index 0e15a672cb4..b84ed9fed32 100644 --- a/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java +++ b/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java @@ -32,10 +32,7 @@ import org.jetbrains.jet.utils.ExceptionUtils; import org.junit.Rule; import org.junit.rules.TestName; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.PrintStream; +import java.io.*; import java.util.List; public class CliBaseTest { @@ -81,13 +78,27 @@ public class CliBaseTest { JetTestUtils.assertEqualsToFile(new File(testDataDir + "/" + testName.getMethodName() + ".out"), actual); } + // TODO: remove after update to newer IDEA where there is a FileUtil.loadLines(String) + @NotNull + public static List loadLines(@NotNull String path) throws IOException { + BufferedReader reader = new BufferedReader(new FileReader(path)); + try { + return FileUtil.loadLines(reader); + } + finally { + reader.close(); + } + } + @NotNull static String[] readArgs( @NotNull String argsFilePath, @NotNull final String testDataDir, @NotNull final String tempDir ) throws IOException { - List lines = FileUtil.loadLines(argsFilePath); + + + List lines = loadLines(argsFilePath); return ArrayUtil.toStringArray(ContainerUtil.mapNotNull(lines, new Function() { @Override