Back-off in ResultProcessor if the result object is an instance of the target type.

We now do not attempt to convert the object if it is an instance of the declared target type.

Closes #2347.
This commit is contained in:
Mark Paluch
2021-04-06 13:29:59 +02:00
parent 3069e261b3
commit 1f583bab3d
2 changed files with 60 additions and 0 deletions

View File

@@ -219,6 +219,10 @@ public class ResultProcessor {
return new ChainingConverter(targetType, source -> {
if (source == null || targetType.isInstance(source)) {
return source;
}
Object intermediate = ChainingConverter.this.convert(source);
return intermediate == null || targetType.isInstance(intermediate) ? intermediate