Browse Source

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

pull/347/head
Oliver Gierke 9 years ago
parent
commit
3ec98b38e2
  1. 3
      src/main/java/org/springframework/data/util/ClassTypeInformation.java
  2. 2
      src/main/java/org/springframework/data/util/TypeDiscoverer.java

3
src/main/java/org/springframework/data/util/ClassTypeInformation.java

@ -92,7 +92,8 @@ public class ClassTypeInformation<S> extends TypeDiscoverer<S> { @@ -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());
}
/**

2
src/main/java/org/springframework/data/util/TypeDiscoverer.java

@ -103,7 +103,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> { @@ -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);

Loading…
Cancel
Save