You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2025/10/28 06:18:04 UTC

(camel) branch main updated: Fix openscanhub findings CSB (#19719)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new a01f01e4b814 Fix openscanhub findings CSB (#19719)
a01f01e4b814 is described below

commit a01f01e4b814d13982a565986a4523ab4734aa88
Author: Roman Stepaniuk <57...@users.noreply.github.com>
AuthorDate: Tue Oct 28 07:17:57 2025 +0100

    Fix openscanhub findings CSB (#19719)
    
    Co-authored-by: Roman Stepaniuk <rs...@redhat.com>
---
 .../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 1fec647be0ec..b28915aed4e1 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
@@ -212,14 +212,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);