Proper resolution of Optional.empty() for header arguments
Issue: SPR-15151
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -53,6 +53,7 @@ import org.springframework.util.ClassUtils;
|
||||
* argument value if it doesn't match the method parameter type.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.0
|
||||
*/
|
||||
public abstract class AbstractNamedValueMethodArgumentResolver implements HandlerMethodArgumentResolver {
|
||||
@@ -106,7 +107,7 @@ public abstract class AbstractNamedValueMethodArgumentResolver implements Handle
|
||||
arg = resolveStringValue(namedValueInfo.defaultValue);
|
||||
}
|
||||
|
||||
if (!ClassUtils.isAssignableValue(parameter.getParameterType(), arg)) {
|
||||
if (parameter != nestedParameter || !ClassUtils.isAssignableValue(parameter.getParameterType(), arg)) {
|
||||
arg = this.conversionService.convert(arg, TypeDescriptor.forObject(arg), new TypeDescriptor(parameter));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user