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


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/ToolConfirms.java:
##########
@@ -303,14 +303,55 @@ public static Call chaos(String command, String 
integration, String id, String r
         String where = integration != null && !integration.isBlank() ? 
integration : "the selected integration";
         String reason = "While the rule is active, the integration's messages 
fail, wait or get lost; exception= can name"
                         + " any exception class";
+        List<String> rules = c.isEmpty() ? List.of() : splitRules(rule);
         return switch (c) {
-            case "add" -> new Call("add a chaos rule to " + where, rule, 
reason);
+            // several rules separated by ; are added together: one per line, 
so each can be read
+            case "add" -> rules.size() > 1
+                    ? new Call("add " + rules.size() + " chaos rules to " + 
where, String.join("\n", rules), reason)
+                    : new Call("add a chaos rule to " + where, rule, reason);
             case "change" -> id != null && !id.isBlank()
                     ? new Call("change chaos rule " + id + " of " + where, 
rule, reason) : null;
             default -> null;
         };
     }
 
+    /**
+     * The rules of a text with several separated by {@code ;}, as 
camel.chaos.rules: a {@code ;} in quotes does not.
+     */

Review Comment:
   💡 **Nit:** The Javadoc is a sentence fragment — "does not" lacks a 
complement (does not *what*?).
   
   ```suggestion
        * Splits a text with several rules separated by {@code ;}; a {@code ;} 
inside quotes does not split.
   ```



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