DATACMNS-440 - Fixed map value type resolving for Map value types.

Previously the map value type resolving algorithm checked the value type to be of type Map again to shortcut the resolution. We now weakened this to an assignment check and eagerly resolve the generic type if its bound on exactly that level already. If no concrete type argument can be found, we fall back to the general generics resolution mechanism.
This commit is contained in:
Oliver Gierke
2014-02-13 12:06:26 +01:00
parent 20846809e1
commit 931a697ec5
2 changed files with 32 additions and 2 deletions

View File

@@ -56,9 +56,13 @@ class ParameterizedTypeInformation<T> extends ParentTypeAwareTypeInformation<T>
@SuppressWarnings("deprecation")
public TypeInformation<?> getMapValueType() {
if (Map.class.equals(getType())) {
if (Map.class.isAssignableFrom(getType())) {
Type[] arguments = type.getActualTypeArguments();
return createInfo(arguments[1]);
if (arguments.length > 1) {
return createInfo(arguments[1]);
}
}
Class<?> rawType = getType();