Test for change to add conversion of defaultValue
This commit adds a test and polishing for a change in
AbstractNamedValueMethodArgumentResolver erroneously committed
with (unrelated) commit e57b942b.
If an argument becomes null after conversion and a default value is
applied, that default value should also pass through conversion.
Closes gh-31336
This commit is contained in:
@@ -274,9 +274,10 @@ public abstract class AbstractNamedValueMethodArgumentResolver implements Handle
|
||||
return value;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static Object convertIfNecessary(
|
||||
MethodParameter parameter, NativeWebRequest webRequest, WebDataBinderFactory binderFactory,
|
||||
NamedValueInfo namedValueInfo, Object arg) throws Exception {
|
||||
NamedValueInfo namedValueInfo, @Nullable Object arg) throws Exception {
|
||||
|
||||
WebDataBinder binder = binderFactory.createBinder(webRequest, null, namedValueInfo.name);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user