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

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

commit a6ecc46a2d5ce840b9cf924cc09471297e0e9cc9
Author: Otavio R. Piske <angusyo...@gmail.com>
AuthorDate: Fri May 24 20:07:26 2024 +0200

    (chores) camel-jbang: fix overly complex conversion to String
    
    Signed-off-by: Otavio R. Piske <angusyo...@gmail.com>
---
 .../java/org/apache/camel/dsl/jbang/core/commands/Run.java   |  4 ++--
 .../apache/camel/dsl/jbang/core/commands/TransformRoute.java |  4 ++--
 .../core/commands/action/CamelStartupRecorderAction.java     |  2 +-
 .../dsl/jbang/core/commands/action/CamelStubAction.java      | 12 ++++++------
 .../camel/dsl/jbang/core/commands/process/ListConsumer.java  |  2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
index 5478a0bdda7..0b6f2430588 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
@@ -847,7 +847,7 @@ public class Run extends CamelCommand {
 
     protected int runQuarkus() throws Exception {
         // create temp run dir
-        File runDir = new File(RUN_PLATFORM_DIR, "" + 
System.currentTimeMillis());
+        File runDir = new File(RUN_PLATFORM_DIR, 
Long.toString(System.currentTimeMillis()));
         if (!this.background) {
             runDir.deleteOnExit();
         }
@@ -914,7 +914,7 @@ public class Run extends CamelCommand {
 
     protected int runSpringBoot() throws Exception {
         // create temp run dir
-        File runDir = new File(RUN_PLATFORM_DIR, "" + 
System.currentTimeMillis());
+        File runDir = new File(RUN_PLATFORM_DIR, 
Long.toString(System.currentTimeMillis()));
         if (!this.background) {
             runDir.deleteOnExit();
         }
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/TransformRoute.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/TransformRoute.java
index f1010750513..e45b546307d 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/TransformRoute.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/TransformRoute.java
@@ -88,8 +88,8 @@ public class TransformRoute extends CamelCommand {
                 main.addInitialProperty("camel.main.dumpRoutes", format);
                 main.addInitialProperty("camel.main.dumpRoutesInclude", 
"routes,rests,routeConfigurations,beans");
                 main.addInitialProperty("camel.main.dumpRoutesLog", "false");
-                
main.addInitialProperty("camel.main.dumpRoutesResolvePlaceholders", "" + 
resolvePlaceholders);
-                
main.addInitialProperty("camel.main.dumpRoutesUriAsParameters", "" + 
uriAsParameters);
+                
main.addInitialProperty("camel.main.dumpRoutesResolvePlaceholders", 
Boolean.toString(resolvePlaceholders));
+                
main.addInitialProperty("camel.main.dumpRoutesUriAsParameters", 
Boolean.toString(uriAsParameters));
                 main.addInitialProperty("camel.main.dumpRoutesOutput", target);
                 main.addInitialProperty("camel.jbang.transform", "true");
                 
main.addInitialProperty("camel.component.properties.ignoreMissingProperty", 
"true");
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelStartupRecorderAction.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelStartupRecorderAction.java
index 017868fe456..ddbbfac59b4 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelStartupRecorderAction.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelStartupRecorderAction.java
@@ -125,7 +125,7 @@ public class CamelStartupRecorderAction extends 
ActionWatchCommand {
 
     private String getDuration(Row r) {
         if (r.duration > 0) {
-            return "" + r.duration;
+            return Long.toString(r.duration);
         }
         return "";
     }
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelStubAction.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelStubAction.java
index 161f38f8c94..1375fb53343 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelStubAction.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelStubAction.java
@@ -270,13 +270,13 @@ public class CamelStubAction extends ActionWatchCommand {
         if (browse) {
             for (Row row : rows) {
                 printer().println(AsciiTable.getTable(AsciiTable.NO_BORDERS, 
List.of(row), Arrays.asList(
-                        new 
Column().header("PID").headerAlign(HorizontalAlign.CENTER).with(r -> "" + 
r.pid),
+                        new 
Column().header("PID").headerAlign(HorizontalAlign.CENTER).with(r -> 
Long.toString(r.pid)),
                         new 
Column().header("NAME").dataAlign(HorizontalAlign.LEFT)
                                 .maxWidth(30, OverflowBehaviour.ELLIPSIS_RIGHT)
                                 .with(r -> r.name),
                         new 
Column().header("QUEUE").dataAlign(HorizontalAlign.LEFT).with(r -> r.queue),
-                        new 
Column().header("MAX").dataAlign(HorizontalAlign.RIGHT).with(r -> "" + r.max),
-                        new 
Column().header("TOTAL").dataAlign(HorizontalAlign.RIGHT).with(r -> "" + 
r.size))));
+                        new 
Column().header("MAX").dataAlign(HorizontalAlign.RIGHT).with(r -> 
Integer.toString(r.max)),
+                        new 
Column().header("TOTAL").dataAlign(HorizontalAlign.RIGHT).with(r -> 
Integer.toString(r.size)))));
 
                 if (row.messages != null) {
                     List<JsonObject> list = row.messages;
@@ -332,12 +332,12 @@ public class CamelStubAction extends ActionWatchCommand {
             }
         } else {
             printer().println(AsciiTable.getTable(AsciiTable.NO_BORDERS, rows, 
Arrays.asList(
-                    new 
Column().header("PID").headerAlign(HorizontalAlign.CENTER).with(r -> "" + 
r.pid),
+                    new 
Column().header("PID").headerAlign(HorizontalAlign.CENTER).with(r -> 
Long.toString(r.pid)),
                     new 
Column().header("NAME").dataAlign(HorizontalAlign.LEFT).maxWidth(30, 
OverflowBehaviour.ELLIPSIS_RIGHT)
                             .with(r -> r.name),
                     new 
Column().header("QUEUE").dataAlign(HorizontalAlign.LEFT).with(r -> r.queue),
-                    new 
Column().header("MAX").dataAlign(HorizontalAlign.RIGHT).with(r -> "" + r.max),
-                    new 
Column().header("TOTAL").dataAlign(HorizontalAlign.RIGHT).with(r -> "" + 
r.size))));
+                    new 
Column().header("MAX").dataAlign(HorizontalAlign.RIGHT).with(r -> 
Integer.toString(r.max)),
+                    new 
Column().header("TOTAL").dataAlign(HorizontalAlign.RIGHT).with(r -> 
Integer.toString(r.size)))));
         }
     }
 
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListConsumer.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListConsumer.java
index 211f3c83368..5a8cce036b2 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListConsumer.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/ListConsumer.java
@@ -176,7 +176,7 @@ public class ListConsumer extends ProcessWatchCommand {
                 new 
Column().header("STATE").headerAlign(HorizontalAlign.CENTER).with(this::getState),
                 new 
Column().header("TYPE").dataAlign(HorizontalAlign.LEFT).maxWidth(20, 
OverflowBehaviour.ELLIPSIS_RIGHT)
                         .with(this::getType),
-                new Column().header("INFLIGHT").with(r -> "" + r.inflight),
+                new Column().header("INFLIGHT").with(r -> 
Integer.toString(r.inflight)),
                 new Column().header("POLL").with(this::getTotal),
                 new 
Column().header("PERIOD").visible(scheduled).with(this::getPeriod),
                 new Column().header("SINCE-LAST").with(this::getSinceLast),

Reply via email to