diff --git a/spring-beans/src/main/java/org/springframework/beans/BeanUtils.java b/spring-beans/src/main/java/org/springframework/beans/BeanUtils.java index 2ac175154199..b6fc6bd53530 100644 --- a/spring-beans/src/main/java/org/springframework/beans/BeanUtils.java +++ b/spring-beans/src/main/java/org/springframework/beans/BeanUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,8 +45,11 @@ * Static convenience methods for JavaBeans: for instantiating beans, * checking bean property types, copying bean properties, etc. * - *

Mainly for use within the framework, but to some degree also - * useful for application classes. + *

Mainly for internal use within the framework, but to some degree also + * useful for application classes. Consider + * Apache Commons BeanUtils, + * BULL - Bean Utils Light Library, + * or similar third-party frameworks for more comprehensive bean utilities. * * @author Rod Johnson * @author Juergen Hoeller @@ -432,7 +435,8 @@ public static PropertyEditor findEditorByConvention(Class targetType) { 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)) { @@ -448,7 +452,7 @@ public static PropertyEditor findEditorByConvention(Class targetType) { catch (ClassNotFoundException ex) { if (logger.isDebugEnabled()) { logger.debug("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; diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java index 9c4c3a8ab473..de39e0feb466 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java @@ -48,7 +48,7 @@ public class ReplaceOverride extends MethodOverride { */ public ReplaceOverride(String methodName, String methodReplacerBeanName) { super(methodName); - Assert.notNull(methodName, "Method replacer bean name must not be null"); + Assert.notNull(methodReplacerBeanName, "Method replacer bean name must not be null"); this.methodReplacerBeanName = methodReplacerBeanName; }