Skip to content

Commit 86e89d5

Browse files
committed
Do not attempt nested PropertyHandler resolution for argument conversion
Includes fix for return type declaration in PropertyAccessor subclasses. See gh-36024
1 parent c813577 commit 86e89d5

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

spring-beans/src/main/java/org/springframework/beans/AbstractNestablePropertyAccessor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,9 @@ private void processLocalProperty(PropertyTokenHolder tokens, PropertyValue pv)
485485

486486
@Override
487487
public @Nullable Class<?> getPropertyType(String propertyName) throws BeansException {
488+
if (this.wrappedObject == null) {
489+
return null;
490+
}
488491
try {
489492
PropertyHandler ph = getPropertyHandler(propertyName);
490493
if (ph != null) {

spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ private CachedIntrospectionResults getCachedIntrospectionResults() {
189189
}
190190

191191
@Override
192-
protected @Nullable BeanPropertyHandler getLocalPropertyHandler(String propertyName) {
192+
protected @Nullable PropertyHandler getLocalPropertyHandler(String propertyName) {
193193
PropertyDescriptor pd = getCachedIntrospectionResults().getPropertyDescriptor(propertyName);
194194
return (pd != null ? new BeanPropertyHandler((GenericTypeAwarePropertyDescriptor) pd) : null);
195195
}

spring-beans/src/main/java/org/springframework/beans/DirectFieldAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected DirectFieldAccessor(Object object, String nestedPath, DirectFieldAcces
7373

7474

7575
@Override
76-
protected @Nullable FieldPropertyHandler getLocalPropertyHandler(String propertyName) {
76+
protected @Nullable PropertyHandler getLocalPropertyHandler(String propertyName) {
7777
FieldPropertyHandler propertyHandler = this.fieldMap.get(propertyName);
7878
if (propertyHandler == null) {
7979
Field field = ReflectionUtils.findField(getWrappedClass(), propertyName);

0 commit comments

Comments
 (0)