ExceptionUtils rewritten in Kotlin

This commit is contained in:
Andrey Breslav
2014-01-29 17:33:40 +04:00
parent d0787795b6
commit 210827b1d5
28 changed files with 107 additions and 120 deletions
@@ -42,7 +42,7 @@ import org.jetbrains.jet.config.CommonConfigurationKeys;
import org.jetbrains.jet.config.CompilerConfiguration;
import org.jetbrains.jet.lang.resolve.java.PackageClassUtils;
import org.jetbrains.jet.lang.resolve.name.FqName;
import org.jetbrains.jet.utils.ExceptionUtils;
import org.jetbrains.jet.utils.UtilsPackage;
import org.jetbrains.jet.utils.KotlinPaths;
import org.jetbrains.jet.utils.PathUtil;
@@ -206,10 +206,10 @@ public class CompileEnvironmentUtil {
throw new CompileEnvironmentException("Invalid jar path " + jarPath, e);
}
catch (IOException e) {
throw ExceptionUtils.rethrow(e);
throw UtilsPackage.rethrow(e);
}
finally {
ExceptionUtils.closeQuietly(outputStream);
UtilsPackage.closeQuietly(outputStream);
}
}
@@ -22,7 +22,7 @@ import jline.console.ConsoleReader;
import jline.console.history.FileHistory;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.config.CompilerConfiguration;
import org.jetbrains.jet.utils.ExceptionUtils;
import org.jetbrains.jet.utils.UtilsPackage;
import java.io.File;
import java.io.PrintWriter;
@@ -59,7 +59,7 @@ public class ReplFromTerminal {
consoleReader.setHistoryEnabled(true);
consoleReader.setHistory(new FileHistory(new File(new File(System.getProperty("user.home")), ".kotlin_history")));
} catch (Exception e) {
throw ExceptionUtils.rethrow(e);
throw UtilsPackage.rethrow(e);
}
}
@@ -72,13 +72,13 @@ public class ReplFromTerminal {
try {
waitRepl.wait();
} catch (Throwable e) {
throw ExceptionUtils.rethrow(e);
throw UtilsPackage.rethrow(e);
}
}
if (replInterpreter != null) {
return replInterpreter;
}
throw ExceptionUtils.rethrow(replInitializationFailed);
throw UtilsPackage.rethrow(replInitializationFailed);
}
}
@@ -94,7 +94,7 @@ public class ReplFromTerminal {
}
}
} catch (Exception e) {
throw ExceptionUtils.rethrow(e);
throw UtilsPackage.rethrow(e);
} finally {
try {
((FileHistory) consoleReader.getHistory()).flush();
@@ -132,7 +132,7 @@ public class ReplFromTerminal {
}
}
catch (Exception e) {
throw ExceptionUtils.rethrow(e);
throw UtilsPackage.rethrow(e);
}
}
@@ -60,7 +60,7 @@ import org.jetbrains.jet.lang.types.lang.InlineUtil;
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
import org.jetbrains.jet.plugin.JetLanguage;
import org.jetbrains.jet.storage.LockBasedStorageManager;
import org.jetbrains.jet.utils.ExceptionUtils;
import org.jetbrains.jet.utils.UtilsPackage;
import java.io.File;
import java.io.PrintWriter;
@@ -119,7 +119,7 @@ public class ReplInterpreter {
classpath.add(file.toURI().toURL());
}
catch (MalformedURLException e) {
throw ExceptionUtils.rethrow(e);
throw UtilsPackage.rethrow(e);
}
}
@@ -281,7 +281,7 @@ public class ReplInterpreter {
PrintWriter writer = new PrintWriter(System.err);
classLoader.dumpClasses(writer);
writer.flush();
throw ExceptionUtils.rethrow(e);
throw UtilsPackage.rethrow(e);
}
}