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 116446fb6bc Polished
116446fb6bc is described below

commit 116446fb6bca2492831f369b3049ecdfff64429e
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Jun 4 14:02:17 2025 +0200

    Polished
---
 .../camel/dsl/jbang/core/commands/ExportBaseCommand.java    | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java
index 12827ad8e60..955ca465adb 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java
@@ -33,6 +33,7 @@ import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Optional;
 import java.util.Properties;
 import java.util.Set;
@@ -757,13 +758,8 @@ public abstract class ExportBaseCommand extends 
CamelCommand {
             customize.apply(profileProps);
         }
 
-        // User properties
-        Properties userProps = new CamelCaseOrderedProperties();
-        prepareUserProperties(userProps);
-
         Path appPropsPath = targetDir.resolve("application.properties");
         StringBuilder content = new StringBuilder();
-
         for (Map.Entry<Object, Object> entry : profileProps.entrySet()) {
             String k = entry.getKey().toString();
             String v = entry.getValue().toString();
@@ -790,6 +786,10 @@ public abstract class ExportBaseCommand extends 
CamelCommand {
                 }
             }
         }
+
+        // User properties
+        Properties userProps = new CamelCaseOrderedProperties();
+        prepareUserProperties(userProps);
         for (Map.Entry<Object, Object> entryUserProp : userProps.entrySet()) {
             String uK = entryUserProp.getKey().toString();
             String uV = entryUserProp.getValue().toString();
@@ -799,6 +799,7 @@ public abstract class ExportBaseCommand extends 
CamelCommand {
             }
         }
 
+        // write all the properties
         Files.writeString(appPropsPath, content.toString(), 
StandardCharsets.UTF_8);
     }
 
@@ -813,7 +814,7 @@ public abstract class ExportBaseCommand extends 
CamelCommand {
     protected Map<String, String> propertiesMap(String[]... propertySources) {
         Map<String, String> result = new LinkedHashMap<>();
         if (propertySources != null) {
-            for (String[] props : Arrays.stream(propertySources).filter((arr) 
-> arr != null).toList()) {
+            for (String[] props : 
Arrays.stream(propertySources).filter(Objects::nonNull).toList()) {
                 for (String s : props) {
                     String[] kv = s.split("=");
                     if (kv.length != 2) {

Reply via email to