AbstractNestablePropertyAccessor resolves a nested property path recursively, one recursive call per path segment, and there was previously no limit on the nesting depth. Consequently, a sufficiently deeply nested property path -- for example, against a self-referential type -- could exhaust the current thread's call stack, resulting in a StackOverflowError which lacks useful diagnostics for developers attempting to assess what went wrong. Note that the existing autoGrowCollectionLimit bounds array and collection growth, not path depth. The same is true for constructor binding via DataBinder.construct(), which constructs a nested constructor argument recursively through a nested property path. Path segments are constrained to declared constructor parameters there, but a self-referential type nonetheless permits an arbitrarily deep path. With this commit, each property accessor tracks the number of nested properties traversed to reach the object that it wraps, and an InvalidPropertyException is thrown once the configured (or default) maxNestedPathDepth limit is exceeded, with a message that reports the configured limit. The limit applies regardless of autoGrowNestedPaths, since resolving an existing deep object graph recurses in the same manner as auto-growing one. Tracking the depth per property accessor rather than threading it through the recursion allows the recursion to dispatch through the protected getPropertyAccessorForPropertyPath(String) method, which subclasses may override, and avoids deriving the depth from the nested path, which would require rescanning an ever longer path prefix at each level. Constructor binding likewise tracks the nesting depth while constructing nested objects as well as indexed and mapped elements, and throws the same InvalidPropertyException once the limit is exceeded. The maxNestedPathDepth (which defaults to 100) can be configured on a per-use-case basis via ConfigurablePropertyAccessor or DataBinder, which applies it to constructor binding directly and supplies it to the property accessor via its binding result. In contrast to the auto-grow collection limit, which is unlimited on a plain accessor, the nesting depth is bounded by default even for programmatic property access, since a large array or collection can be perfectly legitimate whereas a deeply nested property path effectively never is. Specifying zero for the maxNestedPathDepth disables support for nested property paths altogether while continuing to allow simple, indexed, and mapped property access, which is a reasonable way to constrain data binding for a target object that is not intended to be traversed (such as a flat DTO). However, negative values for maxNestedPathDepth are always rejected. Closes gh-37252
Spring Framework

This is the home of the Spring Framework: the foundation for all Spring projects. Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".
Spring provides everything required beyond the Java programming language for creating enterprise applications for a wide range of scenarios and architectures. Please read the Overview section of the reference documentation for a more complete introduction.
Code of Conduct
This project is governed by the Spring Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to spring-code-of-conduct@spring.io.
Access to Binaries
For access to artifacts or a distribution zip, see the Spring Framework Artifacts wiki page.
Documentation
The Spring Framework maintains reference documentation (published and source), GitHub wiki pages, and an API reference. There are also guides and tutorials across Spring projects.
Micro-Benchmarks
See the Micro-Benchmarks wiki page.
Build from Source
See the Build from Source wiki page and the CONTRIBUTING.md file.
Continuous Integration Builds
CI builds are defined with GitHub Actions workflows.
Stay in Touch
Follow @SpringCentral, @SpringFramework, and its team members on 𝕏. In-depth articles can be found at The Spring Blog, and releases are announced via our releases feed.
License
The Spring Framework is released under version 2.0 of the Apache License.