Github user roshannaik commented on a diff in the pull request:
https://github.com/apache/storm/pull/1939#discussion_r101950396
--- Diff:
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/trident/TridentKafkaState.java
---
@@ -98,14 +107,19 @@ public void updateState(List<TridentTuple> tuples,
TridentCollector collector) {
}
if(exceptions.size() > 0){
- String errorMsg = "Could not retrieve result for messages
" + tuples + " from topic = " + topic
- + " because of the following exceptions: \n";
- for (ExecutionException exception : exceptions) {
- errorMsg = errorMsg + exception.getMessage() + "\n";
- }
- LOG.error(errorMsg);
- throw new FailedException(errorMsg);
- }
+ StringBuilder errorMsg = new StringBuilder("Could not retrieve
result for messages ").append(tuples)
--- End diff --
Java auto converts string concats to StringBuilder. There is no need for
this. See discussion here for when is useful to use StringBuilder
http://stackoverflow.com/questions/11942368/why-use-stringbuilder-explicitly-if-the-compiler-converts-string-concatenation-t
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---