From db3570d0cf54162ac7aaeb4897052126815c912e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 28 Aug 2020 22:54:06 +0200 Subject: [PATCH] Polishing --- .../org/springframework/beans/BeanUtils.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 52782a3d7ed..91eff496c0b 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-2019 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. @@ -54,8 +54,11 @@ import org.springframework.util.StringUtils; * 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 @@ -489,7 +492,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)) { @@ -505,7 +509,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; @@ -575,7 +579,7 @@ public abstract class BeanUtils { * @see #isSimpleProperty(Class) */ public static boolean isSimpleValueType(Class type) { - return (type != void.class && type != Void.class && + return (Void.class != type && void.class != type && (ClassUtils.isPrimitiveOrWrapper(type) || Enum.class.isAssignableFrom(type) || CharSequence.class.isAssignableFrom(type) ||