Refactor/simplify KotlinMultiFileTestWithJava and subclasses

This commit is contained in:
Alexander Udalov
2016-02-20 18:56:32 +03:00
committed by Alexander Udalov
parent 06af22b2c1
commit 5f7bc601a8
9 changed files with 82 additions and 147 deletions
@@ -337,15 +337,15 @@ public class KotlinTestUtils {
return new File(getHomeDirectory(), "compiler/testData/mockJDK/jre/lib/annotations.jar");
}
public static void mkdirs(File file) throws IOException {
public static void mkdirs(@NotNull File file) {
if (file.isDirectory()) {
return;
}
if (!file.mkdirs()) {
if (file.exists()) {
throw new IOException("failed to create " + file + " file exists and not a directory");
throw new IllegalStateException("Failed to create " + file + ": file exists and not a directory");
}
throw new IOException();
throw new IllegalStateException("Failed to create " + file);
}
}