You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2020/10/22 14:10:16 UTC
[camel-quarkus] branch master updated: Fixed potentially unclosed
stream fixes #1913
This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/master by this push:
new 2a7dde4 Fixed potentially unclosed stream fixes #1913
2a7dde4 is described below
commit 2a7dde43cc271b156b02d87f445007ef02c4fc7e
Author: aldettinger <al...@gmail.com>
AuthorDate: Thu Oct 22 16:00:20 2020 +0200
Fixed potentially unclosed stream fixes #1913
---
.../java/org/apache/camel/quarkus/component/http/it/HttpRoute.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpRoute.java b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpRoute.java
index ffae71e..930f860 100644
--- a/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpRoute.java
+++ b/integration-tests/http/src/main/java/org/apache/camel/quarkus/component/http/it/HttpRoute.java
@@ -38,9 +38,10 @@ public class HttpRoute extends RouteBuilder {
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
- InputStream stream = HttpRoute.class.getResourceAsStream("/restcountries/cz.json");
- String json = exchange.getContext().getTypeConverter().convertTo(String.class, stream);
- exchange.getMessage().setBody(json);
+ try (InputStream stream = HttpRoute.class.getResourceAsStream("/restcountries/cz.json")) {
+ String json = exchange.getContext().getTypeConverter().convertTo(String.class, stream);
+ exchange.getMessage().setBody(json);
+ }
}
});
}