Skip to content

Commit

Permalink
Use string builder instead of string join. (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
OGKevin committed May 5, 2018
1 parent e8b869b commit db9c94f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/com/bunq/sdk/exception/ExceptionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ public static ApiException createExceptionForResponse(int responseCode, List<Str
}

private static String concatenateAllMessage(List<String> messages, String responseId) {
return String.format(FORMAT_ERROR_MESSAGE, responseId, String.join(SEPARATOR_ERROR_MESSAGES, messages));
StringBuilder stringBuilder = new StringBuilder();

for (String message : messages) {
stringBuilder.append(SEPARATOR_ERROR_MESSAGES);
stringBuilder.append(message);
}

return String.format(FORMAT_ERROR_MESSAGE, responseId, stringBuilder.toString());
}

}

0 comments on commit db9c94f

Please sign in to comment.