DATACMNS-1138 - TypeInformation.specialize(…) now only specializes unresolved parameterized types.

Type specialization - i.e. enrichment of a raw type with a current generic context - is now only done if the current type is not yet resolved completely. This allows wildcarded target references to just fall back to the type to specialize, which will then by definition carry more generics information than the one to be specialized.
This commit is contained in:
Oliver Gierke
2017-08-11 15:29:17 +02:00
parent 756396a065
commit fab854c906
2 changed files with 34 additions and 1 deletions

View File

@@ -184,6 +184,16 @@ class ParameterizedTypeInformation<T> extends ParentTypeAwareTypeInformation<T>
return createInfo(type.getActualTypeArguments()[0]);
}
/*
* (non-Javadoc)
* @see org.springframework.data.util.TypeDiscoverer#specialize(org.springframework.data.util.ClassTypeInformation)
*/
@Override
@SuppressWarnings("unchecked")
public TypeInformation<? extends T> specialize(ClassTypeInformation<?> type) {
return isResolvedCompletely() ? (TypeInformation<? extends T>) type : super.specialize(type);
}
/*
* (non-Javadoc)
* @see org.springframework.data.util.ParentTypeAwareTypeInformation#equals(java.lang.Object)