Skip to content

Commit d59b292

Browse files
committed
Exclude any Java library type from nested constructor binding
Closes gh-31709
1 parent c05b4ce commit d59b292

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-context/src/main/java/org/springframework/validation/DataBinder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,8 @@ private Object createObject(ResolvableType objectType, String nestedPath, ValueR
10181018
protected boolean shouldConstructArgument(MethodParameter param) {
10191019
Class<?> type = param.nestedIfOptional().getNestedParameterType();
10201020
return !(BeanUtils.isSimpleValueType(type) ||
1021-
Collection.class.isAssignableFrom(type) || Map.class.isAssignableFrom(type) || type.isArray());
1021+
Collection.class.isAssignableFrom(type) || Map.class.isAssignableFrom(type) || type.isArray() ||
1022+
type.getPackageName().startsWith("java."));
10221023
}
10231024

10241025
private void validateConstructorArgument(

0 commit comments

Comments
 (0)