ExceptionUtils.closeQuietly
This commit is contained in:
+2
-6
@@ -122,9 +122,7 @@ public class KotlinToJVMBytecodeCompiler {
|
|||||||
throw ExceptionUtils.rethrow(e);
|
throw ExceptionUtils.rethrow(e);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
try {
|
ExceptionUtils.closeQuietly(outputStream);
|
||||||
outputStream.close();
|
|
||||||
} catch (Throwable e) {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -177,9 +175,7 @@ public class KotlinToJVMBytecodeCompiler {
|
|||||||
throw ExceptionUtils.rethrow(e);
|
throw ExceptionUtils.rethrow(e);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
try {
|
ExceptionUtils.closeQuietly(os);
|
||||||
os.close();
|
|
||||||
} catch (Throwable e) {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (outputDir != null) {
|
else if (outputDir != null) {
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.utils;
|
package org.jetbrains.jet.utils;
|
||||||
|
|
||||||
|
import java.io.Closeable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Stepan Koltsov
|
* @author Stepan Koltsov
|
||||||
*/
|
*/
|
||||||
@@ -36,4 +38,13 @@ public class ExceptionUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void closeQuietly(Closeable closeable) {
|
||||||
|
if (closeable != null) {
|
||||||
|
try {
|
||||||
|
closeable.close();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user