Skip to content

Limit bracket depth in PropertyEditorRegistrySupport's addStrippedPropertyPaths() #37020

Description

@sbrannen

Currently, addStrippedPropertyPaths() recursively enumerates all subsets of [key] segments in a property path, producing 2^n − 1 stripped path variants for a path with n bracket pairs, and both callers (findCustomEditor() and guessPropertyTypeFromEditors()) build the full list eagerly before iterating it.

Since property paths with more than a few bracket segments likely do not exist in real-life applications, we can probably revise addStrippedPropertyPaths() so that it short-circuits when the bracket-segment count exceeds a small limit, such as 8, thereby retaining existing behavior for all realistic inputs while rejecting nesting depths greater than the limit.

NOTE: This issue is assigned and therefore not suitable for community contributions.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions