diff --git a/surf/spring-surf/spring-surf/src/main/java/org/springframework/extensions/surf/DependencyHandler.java b/surf/spring-surf/spring-surf/src/main/java/org/springframework/extensions/surf/DependencyHandler.java index ca704b14..198bc21c 100644 --- a/surf/spring-surf/spring-surf/src/main/java/org/springframework/extensions/surf/DependencyHandler.java +++ b/surf/spring-surf/spring-surf/src/main/java/org/springframework/extensions/surf/DependencyHandler.java @@ -668,15 +668,18 @@ public String convertResourceToString(final InputStream in) throws IOException { final Writer writer = new StringBuilderWriter(); final char[] buffer = new char[1024]; - try + // MNT-20206: MNT-20206 Improper Resource Shutdown or Release CWE ID 404 + // LM-2019-02-12 + try (final Reader reader = new BufferedReader(new InputStreamReader(in, this.charset))) { - final Reader reader = new BufferedReader(new InputStreamReader(in, this.charset)); +// final Reader reader = new BufferedReader(new InputStreamReader(in, this.charset)); int n; while ((n = reader.read(buffer)) != -1) { writer.write(buffer, 0, n); } s = writer.toString(); + } finally {