From 7b75697d6de5217e743e026106ad117b3af784cb Mon Sep 17 00:00:00 2001 From: pTalanov Date: Tue, 6 Mar 2012 14:46:21 +0400 Subject: [PATCH] Fix stream close in JsTestUtils --- .../test/org/jetbrains/k2js/test/utils/JsTestUtils.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/js/js.tests/test/org/jetbrains/k2js/test/utils/JsTestUtils.java b/js/js.tests/test/org/jetbrains/k2js/test/utils/JsTestUtils.java index 465e025a358..1201b6087da 100644 --- a/js/js.tests/test/org/jetbrains/k2js/test/utils/JsTestUtils.java +++ b/js/js.tests/test/org/jetbrains/k2js/test/utils/JsTestUtils.java @@ -39,12 +39,9 @@ public final class JsTestUtils { @NotNull public static String readFile(@NotNull String path) throws IOException { + @SuppressWarnings("IOResourceOpenedButNotSafelyClosed") FileInputStream stream = new FileInputStream(new File(path)); - try { - return FileUtil.loadTextAndClose(stream); - } finally { - stream.close(); - } + return FileUtil.loadTextAndClose(stream); } @NotNull