Fix compilation error caused by the change in IDEA API

This commit is contained in:
Alexey Sedunov
2013-11-21 18:39:52 +04:00
parent f2bbbed7f6
commit 2ecac63405
@@ -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<String> 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<String> lines = FileUtil.loadLines(argsFilePath);
List<String> lines = loadLines(argsFilePath);
return ArrayUtil.toStringArray(ContainerUtil.mapNotNull(lines, new Function<String, String>() {
@Override