Consistent type variable resolution for arrays/collections (in particular at field level)
Dropping GenericCollectionTypeResolver in favor of direct ResolvableType usage. Issue: SPR-15160
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.
|
||||
@@ -22,8 +22,8 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.Part;
|
||||
|
||||
import org.springframework.core.GenericCollectionTypeResolver;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.util.WebUtils;
|
||||
@@ -130,7 +130,7 @@ public abstract class MultipartResolutionDelegate {
|
||||
private static Class<?> getCollectionParameterType(MethodParameter methodParam) {
|
||||
Class<?> paramType = methodParam.getNestedParameterType();
|
||||
if (Collection.class == paramType || List.class.isAssignableFrom(paramType)){
|
||||
Class<?> valueType = GenericCollectionTypeResolver.getCollectionParameterType(methodParam);
|
||||
Class<?> valueType = ResolvableType.forMethodParameter(methodParam).asCollection().resolveGeneric();
|
||||
if (valueType != null) {
|
||||
return valueType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user