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


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/TransformJavaRoutes.java:
##########
@@ -111,7 +175,20 @@ static Result transform(List<String> files, String format, 
String output, boolea
             dumper.setOutput(output);
             dumper.dumpRoutes(format);
         }
-        return new Result(true, null);
+    }
+
+    /** Sets the source location of the node and its children (the line 
numbers the parser has set already). */
+    private static void locate(NamedNode node, String location) {
+        if (node.getLocation() == null) {
+            node.setLocation(location);
+        }
+        if (node instanceof RouteDefinition route && route.getInput() != null) 
{
+            route.getInput().setLocation(location);

Review Comment:
   💡 **Nit:** The node's `setLocation` is guarded by `getLocation() == null` 
(line 182–184), but the input's `setLocation` is called unconditionally (as 
long as `input != null`). Not a bug — just inconsistent defensive pattern. For 
symmetry you could add a null-check here too:
   
   ```suggestion
               if (route.getInput().getLocation() == null) {
                   route.getInput().setLocation(location);
               }
   ```



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