bedlaj commented on a change in pull request #4359: URL: https://github.com/apache/camel/pull/4359#discussion_r499265850
########## File path: core/camel-base/src/main/java/org/apache/camel/processor/aggregate/StringAggregationStrategy.java ########## @@ -63,12 +63,12 @@ public StringAggregationStrategy pick(Expression expression) { */ @Override public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { - StringBuffer result; // Aggregate in StringBuffer instead of StringBuilder, to make it thread safe Review comment: StringBuffer is here intentionally because it is mutable and ensures locks. As aggregate method can be called in many threads in parallel, you need to ensure locking in different way (synchronized block, ReentrantLock, ...) before changing this to StringBuilder, otherwise the output will be corrupted. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org