|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2022 the original author or authors. |
| 2 | + * Copyright 2002-2023 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.
|
@@ -194,6 +194,15 @@ public void resolveTransitiveTypeVariableWithDifferentName() {
|
194 | 194 | assertThat(resolved).isEqualTo(E.class);
|
195 | 195 | }
|
196 | 196 |
|
| 197 | + @Test |
| 198 | + public void resolveMethodParameterWithNestedGenerics() { |
| 199 | + Method method = method(WithMethodParameter.class, "nestedGenerics", List.class); |
| 200 | + MethodParameter methodParameter = new MethodParameter(method, 0); |
| 201 | + Type resolvedType = resolveType(methodParameter.getGenericParameterType(), WithMethodParameter.class); |
| 202 | + ParameterizedTypeReference<List<Map<String, Integer>>> reference = new ParameterizedTypeReference<>() {}; |
| 203 | + assertThat(resolvedType).isEqualTo(reference.getType()); |
| 204 | + } |
| 205 | + |
197 | 206 | private static Method method(Class<?> target, String methodName, Class<?>... parameterTypes) {
|
198 | 207 | Method method = findMethod(target, methodName, parameterTypes);
|
199 | 208 | assertThat(method).describedAs(target.getName() + "#" + methodName).isNotNull();
|
@@ -388,5 +397,10 @@ static class FirstSecondService implements First<Integer>, Second<String> {
|
388 | 397 | static class SecondFirstService implements Second<String>, First<Integer> {
|
389 | 398 | }
|
390 | 399 |
|
| 400 | + static class WithMethodParameter { |
| 401 | + public void nestedGenerics(List<Map<String, Integer>> input) { |
| 402 | + } |
| 403 | + } |
| 404 | + |
391 | 405 |
|
392 | 406 | }
|
0 commit comments