You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2025/10/22 13:13:16 UTC
(camel-quarkus) branch 3.27.x updated: Close the class path resource properly after reading from it in BeanioProcessor
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 3.27.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/3.27.x by this push:
new d811d45229 Close the class path resource properly after reading from it in BeanioProcessor
d811d45229 is described below
commit d811d452297d58f76b0ee29a55f467b5d7311703
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Wed Oct 22 15:13:10 2025 +0200
Close the class path resource properly after reading from it in BeanioProcessor
---
.../camel/quarkus/component/beanio/deployment/BeanioProcessor.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/extensions/beanio/deployment/src/main/java/org/apache/camel/quarkus/component/beanio/deployment/BeanioProcessor.java b/extensions/beanio/deployment/src/main/java/org/apache/camel/quarkus/component/beanio/deployment/BeanioProcessor.java
index d1bd95b8b3..569c55ccd2 100644
--- a/extensions/beanio/deployment/src/main/java/org/apache/camel/quarkus/component/beanio/deployment/BeanioProcessor.java
+++ b/extensions/beanio/deployment/src/main/java/org/apache/camel/quarkus/component/beanio/deployment/BeanioProcessor.java
@@ -17,6 +17,7 @@
package org.apache.camel.quarkus.component.beanio.deployment;
import java.io.IOException;
+import java.io.InputStream;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;
@@ -56,8 +57,10 @@ class BeanioProcessor {
BeanioPropertiesBuildItem beanioProperties() {
try {
Properties properties = new Properties();
- properties.load(Thread.currentThread().getContextClassLoader()
- .getResourceAsStream("org/beanio/internal/config/beanio.properties"));
+ try (InputStream in = Thread.currentThread().getContextClassLoader()
+ .getResourceAsStream("org/beanio/internal/config/beanio.properties")) {
+ properties.load(in);
+ }
return new BeanioPropertiesBuildItem(properties);
} catch (IOException e) {
throw new RuntimeException(e);