DATACMNS-422 - Mitigate semantic changes in Spring 4.0's GenericTypeResolver.
In case of an unresolvable generic parameter in TypeDiscoverer's getTypeArgument(…) we check for a generic super type for the given bound and fall back to Object in case we find a parameterized type.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2013 the original author or authors.
|
||||
* Copyright 2011-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -294,6 +294,16 @@ public class ClassTypeInformationUnitTests {
|
||||
from(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-422
|
||||
*/
|
||||
@Test
|
||||
public void returnsNullForRawTypesOnly() {
|
||||
|
||||
assertThat(from(MyRawIterable.class).getComponentType(), is(nullValue()));
|
||||
assertThat(from(MyIterable.class).getComponentType(), is(notNullValue()));
|
||||
}
|
||||
|
||||
static class StringMapContainer extends MapContainer<String> {
|
||||
|
||||
}
|
||||
@@ -418,4 +428,9 @@ public class ClassTypeInformationUnitTests {
|
||||
interface Identifiable {
|
||||
Long getId();
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
interface MyRawIterable extends Iterable {}
|
||||
|
||||
interface MyIterable<T> extends Iterable<T> {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user