File tree 2 files changed +19
-3
lines changed
main/java/org/springframework/core
test/java/org/springframework/core
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2024 the original author or authors.
2
+ * Copyright 2002-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -180,7 +180,7 @@ else if (genericType instanceof ParameterizedType parameterizedType) {
180
180
generics [i ] = resolvedTypeArgument ;
181
181
}
182
182
else {
183
- generics [i ] = ResolvableType .forType (typeArgument );
183
+ generics [i ] = ResolvableType .forType (typeArgument ). resolveType () ;
184
184
}
185
185
}
186
186
else if (typeArgument instanceof ParameterizedType ) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2024 the original author or authors.
2
+ * Copyright 2002-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -211,6 +211,14 @@ void resolveNestedTypeVariable() throws Exception {
211
211
assertThat (ResolvableType .forType (resolved ).getGeneric (0 ).getGeneric (0 ).resolve ()).isEqualTo (String .class );
212
212
}
213
213
214
+ @ Test
215
+ void resolvedTypeWithBase () {
216
+ Type type = method (WithBaseTypes .class , "get" ).getGenericReturnType ();
217
+ Type resolvedType = resolveType (type , WithBaseTypes .class );
218
+ ParameterizedTypeReference <List <A >> reference = new ParameterizedTypeReference <>() {};
219
+ assertThat (resolvedType ).isEqualTo (reference .getType ());
220
+ }
221
+
214
222
private static Method method (Class <?> target , String methodName , Class <?>... parameterTypes ) {
215
223
Method method = findMethod (target , methodName , parameterTypes );
216
224
assertThat (method ).describedAs (target .getName () + "#" + methodName ).isNotNull ();
@@ -398,4 +406,12 @@ public interface ListOfListSupplier<T> {
398
406
public interface StringListOfListSupplier extends ListOfListSupplier <String > {
399
407
}
400
408
409
+ static class WithBaseTypes {
410
+
411
+ <T extends A > List <T > get () {
412
+ return List .of ();
413
+ }
414
+
415
+ }
416
+
401
417
}
You can’t perform that action at this time.
0 commit comments