mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-21 21:39:05 +00:00
Prior to this commit, PropertyDescriptorUtils.determineBasicProperties() incorrectly recognized static `get` and `is` accessor methods as JavaBean read methods, in contrast to the standard java.beans.Introspector, which has always excluded static methods from property discovery. This regression was introduced in Spring Framework 6.0 when determineBasicProperties() replaced the delegation to java.beans.Introspector for the fast property-discovery path used by SimpleBeanInfoFactory. As a result, an unrelated static method such as a singleton accessor could be exposed as a bean property, and reflective access to such a property (for example, via BeanWrapperImpl) could lead to a StackOverflowError if the property's value recursively exposed the same static accessor. To address that, this commit adds Modifier.isStatic(...) checks to the `get` and `is` branches in determineBasicProperties(), mirroring the equivalent check already present in CachedIntrospectionResults.isPlainAccessor(). Static `set` methods continue to be supported as write methods, consistent with the existing behavior in ExtendedBeanInfo. See gh-37068 Closes gh-37081 Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>