You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/10/04 16:28:57 UTC
[GitHub] [camel] mcserra opened a new pull request #4359: CAMEL-15626: Use StringBuilder instead of StringBuffer
mcserra opened a new pull request #4359:
URL: https://github.com/apache/camel/pull/4359
Signed-off-by: Miguel Serra <se...@gmail.com>
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel] mcserra commented on a change in pull request #4359: CAMEL-15626: Use StringBuilder instead of StringBuffer
Posted by GitBox <gi...@apache.org>.
mcserra commented on a change in pull request #4359:
URL: https://github.com/apache/camel/pull/4359#discussion_r499267484
##########
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:
Ok, so maybe it's just simpler to keep StringBuffer... I removed the changes on that file. Thanks
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel] oscerd merged pull request #4359: CAMEL-15626: Use StringBuilder instead of StringBuffer
Posted by GitBox <gi...@apache.org>.
oscerd merged pull request #4359:
URL: https://github.com/apache/camel/pull/4359
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel] bedlaj commented on a change in pull request #4359: CAMEL-15626: Use StringBuilder instead of StringBuffer
Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org