SpEL support for static finals on interfaces
Update ReflectivePropertyAccessor to search for fields on super classes and implemented interfaces. Although the javadoc Class.getFields() implies that all public fields of class should be returned SpelReproTests demonstrates that this is not always the case. Issue: SPR-10125
This commit is contained in:
@@ -383,6 +383,18 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
|
||||
return field;
|
||||
}
|
||||
}
|
||||
if(clazz.getSuperclass() != null) {
|
||||
Field field = findField(name, clazz.getSuperclass(), mustBeStatic);
|
||||
if(field != null) {
|
||||
return field;
|
||||
}
|
||||
}
|
||||
for (Class<?> implementedInterface : clazz.getInterfaces()) {
|
||||
Field field = findField(name, implementedInterface, mustBeStatic);
|
||||
if(field != null) {
|
||||
return field;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user