ExceptionUtils.closeQuietly

This commit is contained in:
Stepan Koltsov
2012-06-13 20:00:54 +04:00
parent edad5c9266
commit dfd3aac900
2 changed files with 13 additions and 6 deletions
@@ -122,9 +122,7 @@ public class KotlinToJVMBytecodeCompiler {
throw ExceptionUtils.rethrow(e);
}
finally {
try {
outputStream.close();
} catch (Throwable e) {}
ExceptionUtils.closeQuietly(outputStream);
}
}
}
@@ -177,9 +175,7 @@ public class KotlinToJVMBytecodeCompiler {
throw ExceptionUtils.rethrow(e);
}
finally {
try {
os.close();
} catch (Throwable e) {}
ExceptionUtils.closeQuietly(os);
}
}
else if (outputDir != null) {
@@ -16,6 +16,8 @@
package org.jetbrains.jet.utils;
import java.io.Closeable;
/**
* @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) {
}
}
}
}