Hoist Class.getName() from String concatenation to dodge an issue related to profile pollution

This commit is contained in:
stsypanov
2019-12-06 14:07:07 +02:00
committed by Juergen Hoeller
parent 7c84695333
commit 484006ce90
4 changed files with 10 additions and 7 deletions

View File

@@ -523,7 +523,8 @@ public abstract class BeanUtils {
return null;
}
}
String editorName = targetType.getName() + "Editor";
String targetTypeName = targetType.getName();
String editorName = targetTypeName + "Editor";
try {
Class<?> editorClass = cl.loadClass(editorName);
if (!PropertyEditor.class.isAssignableFrom(editorClass)) {
@@ -539,7 +540,7 @@ public abstract class BeanUtils {
catch (ClassNotFoundException ex) {
if (logger.isTraceEnabled()) {
logger.trace("No property editor [" + editorName + "] found for type " +
targetType.getName() + " according to 'Editor' suffix convention");
targetTypeName + " according to 'Editor' suffix convention");
}
unknownEditorTypes.add(targetType);
return null;