From 3f3141cddaf878d635318750b49f54147012a137 Mon Sep 17 00:00:00 2001 From: sdeleuze Date: Mon, 22 Jan 2018 10:29:21 +0100 Subject: [PATCH] Add additional test for SPR-16210 Issue: SPR-16210 --- .../core/ResolvableTypeTests.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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(); }