Plug an `InputStream` resource leak
This commit is contained in:
parent
8541d67a14
commit
e1010439d1
|
@ -117,8 +117,9 @@ public class NodejsRequiredSourceModule extends SourceFileModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String loadWrapperSource(String filename) throws IOException {
|
private static String loadWrapperSource(String filename) throws IOException {
|
||||||
InputStream url = NodejsRequiredSourceModule.class.getClassLoader().getResourceAsStream(filename);
|
try (final InputStream url = NodejsRequiredSourceModule.class.getClassLoader().getResourceAsStream(filename)) {
|
||||||
return new String(Streams.inputStream2ByteArray(url));
|
return new String(Streams.inputStream2ByteArray(url));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue