1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
54
54
* Static convenience methods for JavaBeans: for instantiating beans,
55
55
* checking bean property types, copying bean properties, etc.
56
56
*
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.
59
62
*
60
63
* @author Rod Johnson
61
64
* @author Juergen Hoeller
@@ -489,7 +492,8 @@ public static PropertyEditor findEditorByConvention(@Nullable Class<?> targetTyp
489
492
return null ;
490
493
}
491
494
}
492
- String editorName = targetType .getName () + "Editor" ;
495
+ String targetTypeName = targetType .getName ();
496
+ String editorName = targetTypeName + "Editor" ;
493
497
try {
494
498
Class <?> editorClass = cl .loadClass (editorName );
495
499
if (!PropertyEditor .class .isAssignableFrom (editorClass )) {
@@ -505,7 +509,7 @@ public static PropertyEditor findEditorByConvention(@Nullable Class<?> targetTyp
505
509
catch (ClassNotFoundException ex ) {
506
510
if (logger .isTraceEnabled ()) {
507
511
logger .trace ("No property editor [" + editorName + "] found for type " +
508
- targetType . getName () + " according to 'Editor' suffix convention" );
512
+ targetTypeName + " according to 'Editor' suffix convention" );
509
513
}
510
514
unknownEditorTypes .add (targetType );
511
515
return null ;
@@ -575,7 +579,7 @@ public static boolean isSimpleProperty(Class<?> type) {
575
579
* @see #isSimpleProperty(Class)
576
580
*/
577
581
public static boolean isSimpleValueType (Class <?> type ) {
578
- return (type != void . class && type != Void . class &&
582
+ return (Void . class != type && void . class != type &&
579
583
(ClassUtils .isPrimitiveOrWrapper (type ) ||
580
584
Enum .class .isAssignableFrom (type ) ||
581
585
CharSequence .class .isAssignableFrom (type ) ||
0 commit comments