gnodet commented on code in PR #13823:
URL: https://github.com/apache/camel/pull/13823#discussion_r1568234017


##########
core/camel-core-model/src/main/java/org/apache/camel/model/RouteTemplateDefinition.java:
##########
@@ -416,10 +421,10 @@ public RouteDefinition asRouteDefinition() {
         copy.setLogMask(route.getLogMask());
         copy.setMessageHistory(route.getMessageHistory());
         copy.setOutputType(route.getOutputType());
-        copy.setOutputs(route.getOutputs());
-        copy.setRoutePolicies(route.getRoutePolicies());
+        copy.setOutputs(copy(route.getOutputs()));
+        copy.setRoutePolicies(new 
ArrayList<>(requireNonNullElse(route.getRoutePolicies(), emptyList())));

Review Comment:
   While this would be equivalent, I wonder if adding a method such as 
   ```
   List<T> shallowCopy(List<T> list) {
       return (list != null) ? new ArrayList<>(list) : null;
   }
   ```
   same for maps...



-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to