|
|
|
@ -239,6 +239,13 @@ class GenericTypeResolverTests { |
|
|
|
assertThat(resolvableType.resolveGenerics()).containsExactly(Object.class); |
|
|
|
assertThat(resolvableType.resolveGenerics()).containsExactly(Object.class); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test // gh-28904
|
|
|
|
|
|
|
|
void resolveGenericWithDifferentInterfaceOrder() { |
|
|
|
|
|
|
|
Type f = First.class.getTypeParameters()[0]; |
|
|
|
|
|
|
|
assertThat(resolveType(f, FirstSecondService.class)).isEqualTo(Integer.class); |
|
|
|
|
|
|
|
assertThat(resolveType(f, SecondFirstService.class)).isEqualTo(Integer.class); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static Method method(Class<?> target, String methodName, Class<?>... parameterTypes) { |
|
|
|
private static Method method(Class<?> target, String methodName, Class<?>... parameterTypes) { |
|
|
|
Method method = findMethod(target, methodName, parameterTypes); |
|
|
|
Method method = findMethod(target, methodName, parameterTypes); |
|
|
|
assertThat(method).describedAs(target.getName() + "#" + methodName).isNotNull(); |
|
|
|
assertThat(method).describedAs(target.getName() + "#" + methodName).isNotNull(); |
|
|
|
@ -428,4 +435,25 @@ class GenericTypeResolverTests { |
|
|
|
interface IdFixingRepository<T> extends Repository<T, Long> { |
|
|
|
interface IdFixingRepository<T> extends Repository<T, Long> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface First<F extends Number> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default void foo(F f) { |
|
|
|
|
|
|
|
// ...
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface Second<B> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default void bar(B b) { |
|
|
|
|
|
|
|
// ...
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static class FirstSecondService implements First<Integer>, Second<String> { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static class SecondFirstService implements Second<String>, First<Integer> { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|