Extract Class.getName() from String concatenation

This commit extracts a Class.getName() invocation from String
concatenation in AbstractMonitoringInterceptor to avoid an issue
related to profile pollution.

Closes gh-25324
This commit is contained in:
Сергей Цыпанов 2020-06-27 14:50:50 +03:00 committed by Sam Brannen
parent 9876ca003b
commit d08ce303f1
1 changed files with 2 additions and 1 deletions

View File

@ -103,7 +103,8 @@ public abstract class AbstractMonitoringInterceptor extends AbstractTraceInterce
if (this.logTargetClassInvocation && clazz.isInstance(invocation.getThis())) { if (this.logTargetClassInvocation && clazz.isInstance(invocation.getThis())) {
clazz = invocation.getThis().getClass(); clazz = invocation.getThis().getClass();
} }
return getPrefix() + clazz.getName() + '.' + method.getName() + getSuffix(); String clazzName = clazz.getName();
return getPrefix() + clazzName + '.' + method.getName() + getSuffix();
} }
} }