We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efa069f commit 7790122Copy full SHA for 7790122
graphviz-java/src/main/java/guru/nidi/graphviz/engine/IoUtils.java
@@ -33,7 +33,11 @@ static String readStream(InputStream in) throws IOException {
33
}
34
35
static boolean isOnClasspath(String resource) {
36
- return Thread.currentThread().getContextClassLoader().getResourceAsStream(resource) != null;
+ try (final InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource)) {
37
+ return stream != null;
38
+ } catch (IOException e) {
39
+ throw new AssertionError(e);
40
+ }
41
42
43
static void closeQuietly(AutoCloseable c) {
0 commit comments