Skip to content

Commit 3f3141c

Browse files
committed
Add additional test for SPR-16210
Issue: SPR-16210
1 parent 646fcc5 commit 3f3141c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spring-core/src/test/java/org/springframework/core/ResolvableTypeTests.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
*
6565
* @author Phillip Webb
6666
* @author Juergen Hoeller
67+
* @author Sebastien Deleuze
6768
*/
6869
@SuppressWarnings("rawtypes")
6970
@RunWith(MockitoJUnitRunner.class)
@@ -261,6 +262,19 @@ public void forMethodParameterMustNotBeNull() throws Exception {
261262
ResolvableType.forMethodParameter(null);
262263
}
263264

265+
@Test // SPR-16210
266+
public void forMethodParameterWithSameSignatureAndGenerics() throws Exception {
267+
Method method = Methods.class.getMethod("list1");
268+
MethodParameter methodParameter = MethodParameter.forExecutable(method, -1);
269+
ResolvableType type = ResolvableType.forMethodParameter(methodParameter);
270+
assertThat(((MethodParameter)type.getSource()).getMethod(), equalTo(method));
271+
272+
method = Methods.class.getMethod("list2");
273+
methodParameter = MethodParameter.forExecutable(method, -1);
274+
type = ResolvableType.forMethodParameter(methodParameter);
275+
assertThat(((MethodParameter)type.getSource()).getMethod(), equalTo(method));
276+
}
277+
264278
@Test
265279
public void forMethodReturn() throws Exception {
266280
Method method = Methods.class.getMethod("charSequenceReturn");
@@ -1439,6 +1453,10 @@ interface Methods<T> {
14391453
T typedReturn();
14401454

14411455
Set<?> wildcardSet();
1456+
1457+
List<String> list1();
1458+
1459+
List<String> list2();
14421460
}
14431461

14441462

0 commit comments

Comments
 (0)