gnodet-bot commented on code in PR #29931:
URL: https://github.com/apache/camel/pull/29931#discussion_r4573381865


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Debug.java:
##########
@@ -622,13 +625,37 @@ protected int doRunDebug(KameletMain main) throws 
Exception {
         return 0;
     }
 
-    private void removeDebugOnlyOptions(List<String> cmds) {
-        // only check Debug.class (not super classes)
-        RunHelper.doWithFields(Debug.class, fc -> cmds.removeIf(c -> {
-            String n1 = "--" + fc.getName();
-            String n2 = "--" + StringHelper.camelCaseToDash(fc.getName());
-            return c.startsWith(n1) || c.startsWith(n2);
-        }));
+    /**
+     * The arguments without the options of camel debug, which camel run does 
not have: each by its exact name, with its
+     * value (--breakpoint=tick, or --breakpoint tick). Before, every argument 
that started with the name of a field was
+     * removed, such as --source-dir=... for the field source, and the value 
of --breakpoint tick was left behind as a
+     * file (CAMEL-26930).

Review Comment:
   The two Javadoc sentences exceed the 25-word readability threshold (first: 
26 words, second: 33 words), and use passive voice (`was removed`, `was left 
behind`). Suggested rewrite:
   
   ```suggestion
        * Returns the arguments of {@code camel run} that {@code camel debug} 
delegates to it, omitting the debug-only options.
        * Each option is removed by its exact name and value. The previous 
implementation removed any argument whose prefix
        * matched a field name (e.g. {@code --source-dir} for field {@code 
source}) and left space-separated values
        * as stray positional arguments (CAMEL-26930).
   ```



-- 
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