Restore prior resolveTypeArguments behavior

Restore prior behavior of GenericTypeResolver.resolveTypeArguments to
never include null elements in the returned array.

Issue: SPR-11030
This commit is contained in:
Phillip Webb
2013-10-25 17:23:36 -07:00
parent 393cfcff40
commit 1a3ba79071
4 changed files with 30 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
@@ -136,6 +137,12 @@ public class GenericTypeResolverTests {
assertThat(x, equalTo((Type) Long.class));
}
@Test
public void getGenericsCannotBeResovled() throws Exception {
// SPR-11030
Class[] resolved = GenericTypeResolver.resolveTypeArguments(List.class, Iterable.class);
assertThat(resolved, equalTo(new Class[] { Object.class }));
}
public interface MyInterfaceType<T> {
}