Skip to content

Commit db3570d

Browse files
committed
Polishing
1 parent eba1aba commit db3570d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

spring-beans/src/main/java/org/springframework/beans/BeanUtils.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,8 +54,11 @@
5454
* Static convenience methods for JavaBeans: for instantiating beans,
5555
* checking bean property types, copying bean properties, etc.
5656
*
57-
* <p>Mainly for use within the framework, but to some degree also
58-
* useful for application classes.
57+
* <p>Mainly for internal use within the framework, but to some degree also
58+
* useful for application classes. Consider
59+
* <a href="https://commons.apache.org/proper/commons-beanutils/">Apache Commons BeanUtils</a>,
60+
* <a href="https://hotelsdotcom.github.io/bull/">BULL - Bean Utils Light Library</a>,
61+
* or similar third-party frameworks for more comprehensive bean utilities.
5962
*
6063
* @author Rod Johnson
6164
* @author Juergen Hoeller
@@ -489,7 +492,8 @@ public static PropertyEditor findEditorByConvention(@Nullable Class<?> targetTyp
489492
return null;
490493
}
491494
}
492-
String editorName = targetType.getName() + "Editor";
495+
String targetTypeName = targetType.getName();
496+
String editorName = targetTypeName + "Editor";
493497
try {
494498
Class<?> editorClass = cl.loadClass(editorName);
495499
if (!PropertyEditor.class.isAssignableFrom(editorClass)) {
@@ -505,7 +509,7 @@ public static PropertyEditor findEditorByConvention(@Nullable Class<?> targetTyp
505509
catch (ClassNotFoundException ex) {
506510
if (logger.isTraceEnabled()) {
507511
logger.trace("No property editor [" + editorName + "] found for type " +
508-
targetType.getName() + " according to 'Editor' suffix convention");
512+
targetTypeName + " according to 'Editor' suffix convention");
509513
}
510514
unknownEditorTypes.add(targetType);
511515
return null;
@@ -575,7 +579,7 @@ public static boolean isSimpleProperty(Class<?> type) {
575579
* @see #isSimpleProperty(Class)
576580
*/
577581
public static boolean isSimpleValueType(Class<?> type) {
578-
return (type != void.class && type != Void.class &&
582+
return (Void.class != type && void.class != type &&
579583
(ClassUtils.isPrimitiveOrWrapper(type) ||
580584
Enum.class.isAssignableFrom(type) ||
581585
CharSequence.class.isAssignableFrom(type) ||

0 commit comments

Comments
 (0)