TypeDescriptor properly narrows ResolvableType for non-typed collection elements
Issue: SPR-14971
(cherry picked from commit aef1460)
This commit is contained in:
@@ -190,7 +190,7 @@ public class TypeDescriptor implements Serializable {
|
||||
return this;
|
||||
}
|
||||
ResolvableType narrowed = ResolvableType.forType(value.getClass(), getResolvableType());
|
||||
return new TypeDescriptor(narrowed, null, getAnnotations());
|
||||
return new TypeDescriptor(narrowed, value.getClass(), getAnnotations());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -439,7 +439,10 @@ public class TypeDescriptor implements Serializable {
|
||||
if (typeDescriptor != null) {
|
||||
return typeDescriptor.narrow(value);
|
||||
}
|
||||
return (value != null ? new TypeDescriptor(getResolvableType(), value.getClass(), getAnnotations()) : null);
|
||||
if (value != null) {
|
||||
return narrow(value);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user