diff --git a/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java b/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java index 9da4e13e11..c36126a7b3 100644 --- a/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java +++ b/spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java @@ -64,6 +64,7 @@ import static org.mockito.BDDMockito.*; * * @author Phillip Webb * @author Juergen Hoeller + * @author Sebastien Deleuze */ @SuppressWarnings("rawtypes") @RunWith(MockitoJUnitRunner.class) @@ -261,6 +262,19 @@ public class ResolvableTypeTests { ResolvableType.forMethodParameter(null); } + @Test // SPR-16210 + public void forMethodParameterWithSameSignatureAndGenerics() throws Exception { + Method method = Methods.class.getMethod("list1"); + MethodParameter methodParameter = MethodParameter.forExecutable(method, -1); + ResolvableType type = ResolvableType.forMethodParameter(methodParameter); + assertThat(((MethodParameter)type.getSource()).getMethod(), equalTo(method)); + + method = Methods.class.getMethod("list2"); + methodParameter = MethodParameter.forExecutable(method, -1); + type = ResolvableType.forMethodParameter(methodParameter); + assertThat(((MethodParameter)type.getSource()).getMethod(), equalTo(method)); + } + @Test public void forMethodReturn() throws Exception { Method method = Methods.class.getMethod("charSequenceReturn"); @@ -1439,6 +1453,10 @@ public class ResolvableTypeTests { T typedReturn(); Set wildcardSet(); + + List list1(); + + List list2(); }