|
|
|
|
@ -19,7 +19,6 @@ package org.springframework.core;
@@ -19,7 +19,6 @@ package org.springframework.core;
|
|
|
|
|
import java.lang.reflect.Method; |
|
|
|
|
import java.lang.reflect.Type; |
|
|
|
|
import java.lang.reflect.TypeVariable; |
|
|
|
|
|
|
|
|
|
import java.util.Collection; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Map; |
|
|
|
|
@ -27,7 +26,6 @@ import java.util.Map;
@@ -27,7 +26,6 @@ import java.util.Map;
|
|
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.*; |
|
|
|
|
|
|
|
|
|
import static org.springframework.core.GenericTypeResolver.*; |
|
|
|
|
import static org.springframework.util.ReflectionUtils.*; |
|
|
|
|
|
|
|
|
|
@ -79,7 +77,6 @@ public class GenericTypeResolverTests {
@@ -79,7 +77,6 @@ public class GenericTypeResolverTests {
|
|
|
|
|
*/ |
|
|
|
|
@Test |
|
|
|
|
public void genericMethodReturnTypes() { |
|
|
|
|
|
|
|
|
|
Method notParameterized = findMethod(MyTypeWithMethods.class, "notParameterized", new Class[] {}); |
|
|
|
|
assertEquals(String.class, resolveReturnTypeForGenericMethod(notParameterized, new Object[] {})); |
|
|
|
|
|
|
|
|
|
@ -156,6 +153,11 @@ public class GenericTypeResolverTests {
@@ -156,6 +153,11 @@ public class GenericTypeResolverTests {
|
|
|
|
|
assertEquals(Integer[].class, resolveType(genericArrMessageMethodParam.getGenericParameterType(), varMap)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testBoundParameterizedType() { |
|
|
|
|
assertEquals(B.class, resolveTypeArgument(TestImpl.class, ITest.class)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public interface MyInterfaceType<T> { |
|
|
|
|
} |
|
|
|
|
@ -273,4 +275,13 @@ public class GenericTypeResolverTests {
@@ -273,4 +275,13 @@ public class GenericTypeResolverTests {
|
|
|
|
|
static class GenericClass<T> { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class A{} |
|
|
|
|
|
|
|
|
|
class B<T>{} |
|
|
|
|
|
|
|
|
|
class ITest<T>{} |
|
|
|
|
|
|
|
|
|
class TestImpl<I extends A, T extends B<I>> extends ITest<T>{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|