DATACMNS-401 - Some cleanups regarding generics and deprecations.
Suppress deprecation warnings for GenericTypeResolver for now. Added Simple(Property|Association)Handler to ease working with untyped PersistentProperty instances without having to fall back to raw types. Polished Sonargraph architecture description.
This commit is contained in:
@@ -97,6 +97,7 @@ public class ClassTypeInformation<S> extends TypeDiscoverer<S> {
|
||||
*
|
||||
* @param type
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
ClassTypeInformation(Class<S> type) {
|
||||
this(type, GenericTypeResolver.getTypeVariableMap(type));
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ class ParameterizedTypeInformation<T> extends ParentTypeAwareTypeInformation<T>
|
||||
* @see org.springframework.data.util.TypeDiscoverer#getMapValueType()
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public TypeInformation<?> getMapValueType() {
|
||||
|
||||
if (Map.class.equals(getType())) {
|
||||
|
||||
@@ -47,8 +47,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
|
||||
private final Type type;
|
||||
@SuppressWarnings("rawtypes")
|
||||
private final Map<TypeVariable, Type> typeVariableMap;
|
||||
@SuppressWarnings("rawtypes") private final Map<TypeVariable, Type> typeVariableMap;
|
||||
private final Map<String, TypeInformation<?>> fieldTypes = new ConcurrentHashMap<String, TypeInformation<?>>();
|
||||
|
||||
private Class<S> resolvedType;
|
||||
@@ -95,6 +94,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
return new ClassTypeInformation((Class<?>) fieldType);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
Map<TypeVariable, Type> variableMap = GenericTypeResolver.getTypeVariableMap(resolveType(fieldType));
|
||||
|
||||
if (fieldType instanceof ParameterizedType) {
|
||||
@@ -136,9 +136,8 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
protected Class<S> resolveType(Type type) {
|
||||
|
||||
return (Class<S>) GenericTypeResolver.resolveType(type, getTypeVariableMap());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user