Use ResolvableType to back TypeInformation.

Reworked the implementation of the TypeInformation type hierarchy to be based on Spring's ResolvableType for most of the heavy-lifting.

Original pull request: #2572.
Related ticket: #2312.
This commit is contained in:
Christoph Strobl
2021-11-18 09:06:15 +01:00
committed by Oliver Drotbohm
parent 8721ab4170
commit 1d6331ccb6
16 changed files with 530 additions and 1269 deletions

View File

@@ -146,7 +146,7 @@ public class JsonProjectingMethodInterceptorFactory implements MethodInterceptor
public Object invoke(MethodInvocation invocation) throws Throwable {
Method method = invocation.getMethod();
TypeInformation<Object> returnType = ClassTypeInformation.fromReturnTypeOf(method);
TypeInformation<?> returnType = ClassTypeInformation.fromReturnTypeOf(method);
ResolvableType type = ResolvableType.forMethodReturnType(method);
boolean isCollectionResult = Collection.class.isAssignableFrom(type.getRawClass());
type = isCollectionResult ? type : ResolvableType.forClassWithGenerics(List.class, type);