File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
spring-core/src/test/java/org/springframework/core Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 64
64
*
65
65
* @author Phillip Webb
66
66
* @author Juergen Hoeller
67
+ * @author Sebastien Deleuze
67
68
*/
68
69
@ SuppressWarnings ("rawtypes" )
69
70
@ RunWith (MockitoJUnitRunner .class )
@@ -261,6 +262,19 @@ public void forMethodParameterMustNotBeNull() throws Exception {
261
262
ResolvableType .forMethodParameter (null );
262
263
}
263
264
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
+
264
278
@ Test
265
279
public void forMethodReturn () throws Exception {
266
280
Method method = Methods .class .getMethod ("charSequenceReturn" );
@@ -1439,6 +1453,10 @@ interface Methods<T> {
1439
1453
T typedReturn ();
1440
1454
1441
1455
Set <?> wildcardSet ();
1456
+
1457
+ List <String > list1 ();
1458
+
1459
+ List <String > list2 ();
1442
1460
}
1443
1461
1444
1462
You can’t perform that action at this time.
0 commit comments