Fix stream close in JsTestUtils
This commit is contained in:
@@ -39,12 +39,9 @@ public final class JsTestUtils {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static String readFile(@NotNull String path) throws IOException {
|
public static String readFile(@NotNull String path) throws IOException {
|
||||||
|
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
|
||||||
FileInputStream stream = new FileInputStream(new File(path));
|
FileInputStream stream = new FileInputStream(new File(path));
|
||||||
try {
|
return FileUtil.loadTextAndClose(stream);
|
||||||
return FileUtil.loadTextAndClose(stream);
|
|
||||||
} finally {
|
|
||||||
stream.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
Reference in New Issue
Block a user