Skip to content

Commit

Permalink
Exclude any Java library type from nested constructor binding
Browse files Browse the repository at this point in the history
Closes gh-31709
  • Loading branch information
rstoyanchev committed Dec 1, 2023
1 parent c05b4ce commit d59b292
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -1018,7 +1018,8 @@ private Object createObject(ResolvableType objectType, String nestedPath, ValueR
protected boolean shouldConstructArgument(MethodParameter param) {
Class<?> type = param.nestedIfOptional().getNestedParameterType();
return !(BeanUtils.isSimpleValueType(type) ||
Collection.class.isAssignableFrom(type) || Map.class.isAssignableFrom(type) || type.isArray());
Collection.class.isAssignableFrom(type) || Map.class.isAssignableFrom(type) || type.isArray() ||
type.getPackageName().startsWith("java."));
}

private void validateConstructorArgument(
Expand Down

0 comments on commit d59b292

Please sign in to comment.