Skip to content

Commit 900abfc

Browse files
quaffjhoeller
authored andcommitted
Temporal should be simple value type like Date
1 parent 574dffb commit 900abfc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.lang.reflect.Modifier;
2525
import java.net.URI;
2626
import java.net.URL;
27+
import java.time.temporal.Temporal;
2728
import java.util.Arrays;
2829
import java.util.Collections;
2930
import java.util.Date;
@@ -584,7 +585,7 @@ public static MethodParameter getWriteMethodParameter(PropertyDescriptor pd) {
584585
/**
585586
* Check if the given type represents a "simple" property:
586587
* a primitive, a String or other CharSequence, a Number, a Date,
587-
* a URI, a URL, a Locale, a Class, or a corresponding array.
588+
* a Temporal, a URI, a URL, a Locale, a Class, or a corresponding array.
588589
* <p>Used to determine properties to check for a "simple" dependency-check.
589590
* @param clazz the type to check
590591
* @return whether the given type represents a "simple" property
@@ -599,7 +600,7 @@ public static boolean isSimpleProperty(Class<?> clazz) {
599600
/**
600601
* Check if the given type represents a "simple" value type:
601602
* a primitive, an enum, a String or other CharSequence, a Number, a Date,
602-
* a URI, a URL, a Locale or a Class.
603+
* a Temporal, a URI, a URL, a Locale or a Class.
603604
* @param clazz the type to check
604605
* @return whether the given type represents a "simple" value type
605606
*/
@@ -609,6 +610,7 @@ public static boolean isSimpleValueType(Class<?> clazz) {
609610
CharSequence.class.isAssignableFrom(clazz) ||
610611
Number.class.isAssignableFrom(clazz) ||
611612
Date.class.isAssignableFrom(clazz) ||
613+
Temporal.class.isAssignableFrom(clazz) ||
612614
URI.class == clazz || URL.class == clazz ||
613615
Locale.class == clazz || Class.class == clazz);
614616
}

0 commit comments

Comments
 (0)