DATACMNS-956 - Ensure consistent use of ClassTypeInformation.from(…).

This commit is contained in:
Oliver Gierke
2016-12-12 17:09:00 +01:00
parent f93d2df4f1
commit c52aba358d
2 changed files with 3 additions and 2 deletions

View File

@@ -92,7 +92,8 @@ public class ClassTypeInformation<S> extends TypeDiscoverer<S> {
public static <S> TypeInformation<S> fromReturnTypeOf(Method method) {
Assert.notNull(method, "Method must not be null!");
return new ClassTypeInformation(method.getDeclaringClass()).createInfo(method.getGenericReturnType());
return (TypeInformation<S>) ClassTypeInformation.from(method.getDeclaringClass())
.createInfo(method.getGenericReturnType());
}
/**

View File

@@ -103,7 +103,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
}
if (fieldType instanceof Class) {
return new ClassTypeInformation((Class<?>) fieldType);
return ClassTypeInformation.from((Class<?>) fieldType);
}
Class<S> resolveType = resolveType(fieldType);