X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=aai-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Flogging%2FLogFormatTools.java;h=d91ba19d02800e66022fd0bb6ac35e22322a5693;hb=a86d6a6644d6de3f3f814cd6e25cfe2213d5dd05;hp=482b445cfeaf818fa13a13ee30ca25bd49e02dc7;hpb=a395fa69a28a04d0a667fe458b4f10497a1d6794;p=aai%2Faai-common.git diff --git a/aai-core/src/main/java/org/onap/aai/logging/LogFormatTools.java b/aai-core/src/main/java/org/onap/aai/logging/LogFormatTools.java index 482b445c..d91ba19d 100644 --- a/aai-core/src/main/java/org/onap/aai/logging/LogFormatTools.java +++ b/aai-core/src/main/java/org/onap/aai/logging/LogFormatTools.java @@ -54,7 +54,10 @@ public class LogFormatTools { * @throws AAIException the AAI exception */ public static String getStackTop(Throwable e) { - StringBuffer stackMessage = new StringBuffer(); + // StringBuilder is more efficient than StringBuffer and should only + // StringBuffer is only supposed to be used if multiple threads are modifying + // the same object and since this object is created locally not necessary + StringBuilder stackMessage = new StringBuilder(); int maxStackTraceEntries = 10; try { maxStackTraceEntries = Integer.valueOf(AAIConfig.get(AAIConstants.LOGGING_MAX_STACK_TRACE_ENTRIES));