Use concatenation instead of torn StringBuilder::append chain
This commit is contained in:
parent
cd0b517abf
commit
604361ee1f
|
|
@ -98,16 +98,12 @@ public abstract class AbstractMonitoringInterceptor extends AbstractTraceInterce
|
||||||
* @see #setSuffix
|
* @see #setSuffix
|
||||||
*/
|
*/
|
||||||
protected String createInvocationTraceName(MethodInvocation invocation) {
|
protected String createInvocationTraceName(MethodInvocation invocation) {
|
||||||
StringBuilder sb = new StringBuilder(getPrefix());
|
|
||||||
Method method = invocation.getMethod();
|
Method method = invocation.getMethod();
|
||||||
Class<?> clazz = method.getDeclaringClass();
|
Class<?> clazz = method.getDeclaringClass();
|
||||||
if (this.logTargetClassInvocation && clazz.isInstance(invocation.getThis())) {
|
if (this.logTargetClassInvocation && clazz.isInstance(invocation.getThis())) {
|
||||||
clazz = invocation.getThis().getClass();
|
clazz = invocation.getThis().getClass();
|
||||||
}
|
}
|
||||||
sb.append(clazz.getName());
|
return getPrefix() + clazz.getName() + '.' + method.getName() + getSuffix();
|
||||||
sb.append('.').append(method.getName());
|
|
||||||
sb.append(getSuffix());
|
|
||||||
return sb.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,12 +89,10 @@ public class GenericBeanDefinition extends AbstractBeanDefinition {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder("Generic bean");
|
|
||||||
if (this.parentName != null) {
|
if (this.parentName != null) {
|
||||||
sb.append(" with parent '").append(this.parentName).append("'");
|
return "Generic bean with parent '" + this.parentName + "': " + super.toString();
|
||||||
}
|
}
|
||||||
sb.append(": ").append(super.toString());
|
return "Generic bean: " + super.toString();
|
||||||
return sb.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -212,10 +212,9 @@ public abstract class AnnotationJCacheOperationSource extends AbstractFallbackJC
|
||||||
parameters.add(parameterType.getName());
|
parameters.add(parameterType.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder(method.getDeclaringClass().getName());
|
return method.getDeclaringClass().getName()
|
||||||
sb.append(".").append(method.getName());
|
+ '.' + method.getName()
|
||||||
sb.append("(").append(StringUtils.collectionToCommaDelimitedString(parameters)).append(")");
|
+ '(' + StringUtils.collectionToCommaDelimitedString(parameters) + ')';
|
||||||
return sb.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int countNonNull(Object... instances) {
|
private int countNonNull(Object... instances) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue