lnearlol commented on code in PR #21533:
URL: https://github.com/apache/camel/pull/21533#discussion_r2823216549


##########
catalog/camel-csimple-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java:
##########
@@ -283,24 +283,17 @@ private void loadConfiguration() {
     }
 
     private static String load(String configFile) {
-        String loaded;
-        InputStream is = null;
-        try {
-            // load from file system
-            File file = new File(configFile);
-            if (file.exists()) {
-                is = new FileInputStream(file);
-            }
-            if (is == null) {
-                return null;
-            }
-            loaded = IOHelper.loadText(is);
+        // load from file system
+        File file = new File(configFile);
+        if (!file.exists()) {
+            return null;
+        }
+
+        try (InputStream is = new FileInputStream(file)) {
+            return IOHelper.loadText(is);
         } catch (IOException e) {
             throw new RuntimeCamelException("Cannot load " + configFile);

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to