Use concatenation instead of torn StringBuilder::append chain

This commit is contained in:
stsypanov
2019-04-09 11:44:16 +03:00
committed by Juergen Hoeller
parent cd0b517abf
commit 604361ee1f
3 changed files with 6 additions and 13 deletions

View File

@@ -98,16 +98,12 @@ public abstract class AbstractMonitoringInterceptor extends AbstractTraceInterce
* @see #setSuffix
*/
protected String createInvocationTraceName(MethodInvocation invocation) {
StringBuilder sb = new StringBuilder(getPrefix());
Method method = invocation.getMethod();
Class<?> clazz = method.getDeclaringClass();
if (this.logTargetClassInvocation && clazz.isInstance(invocation.getThis())) {
clazz = invocation.getThis().getClass();
}
sb.append(clazz.getName());
sb.append('.').append(method.getName());
sb.append(getSuffix());
return sb.toString();
return getPrefix() + clazz.getName() + '.' + method.getName() + getSuffix();
}
}