This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-4.14.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.14.x by this push:
     new b63908baf097 Fix openscanhub findings CSB (#19719) (#19733)
b63908baf097 is described below

commit b63908baf097aeebddc87303cc6a845ca0eb1249
Author: Marco Carletti <[email protected]>
AuthorDate: Tue Oct 28 09:11:20 2025 +0100

    Fix openscanhub findings CSB (#19719) (#19733)
    
    Co-authored-by: Roman Stepaniuk <[email protected]>
    Co-authored-by: Roman Stepaniuk <[email protected]>
---
 .../src/main/java/org/apache/camel/maven/GenerateMojo.java            | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git 
a/catalog/camel-csimple-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
 
b/catalog/camel-csimple-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
index 43313e8a5db1..03eaeddd5dc6 100644
--- 
a/catalog/camel-csimple-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
+++ 
b/catalog/camel-csimple-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java
@@ -206,14 +206,12 @@ public class GenerateMojo extends AbstractExecMojo {
 
     private void addXmlFiles(File file, List<CamelCSimpleExpressionDetails> 
csimpleExpressions) {
         if (matchRouteFile(file)) {
-            try {
+            try (InputStream is = new FileInputStream(file)) {
                 List<CamelCSimpleExpressionDetails> fileSimpleExpressions = 
new ArrayList<>();
                 // parse the xml source code and find Camel routes
                 String fqn = file.getPath();
                 String baseDir = ".";
-                InputStream is = new FileInputStream(file);
                 XmlRouteParser.parseXmlRouteCSimpleExpressions(is, baseDir, 
fqn, fileSimpleExpressions);
-                is.close();
                 csimpleExpressions.addAll(fileSimpleExpressions);
             } catch (Exception e) {
                 getLog().warn("Error parsing xml file " + file + " code due " 
+ e.getMessage(), e);

Reply via email to