Skip to content

Gh 50831 fix indexed binder oom - #51143

Open
elephant-y wants to merge 1 commit into
spring-projects:mainfrom
elephant-y:gh-50831-fix-indexed-binder-oom
Open

Gh 50831 fix indexed binder oom#51143
elephant-y wants to merge 1 commit into
spring-projects:mainfrom
elephant-y:gh-50831-fix-indexed-binder-oom

Conversation

@elephant-y

Copy link
Copy Markdown

No description provided.

When a @ConfigurationProperties List element's property holds a non-null
default value (such as Optional.empty()), IndexedElementsBinder would
loop indefinitely because JavaBeanBinder treated the fallback value as
a successfully bound element. This regression was introduced in 4.1.0
where fallback-to-default behavior changed, turning a previously bounded
BindException into an OutOfMemoryError.

The fix introduces PropertyBinding, a record that captures both the
bound value and whether it originated from a configuration source.
JavaBeanBinder and ValueObjectBinder now use fromSource() to determine
if binding actually occurred, rather than relying on null checks that
fail for non-null default values like Optional.empty().

fromSource is determined by checking both direct property match
(findProperty) and descendant presence (containsDescendantOf=PRESENT),
ensuring indexed and nested properties are correctly recognized as
source-bound while non-iterable sources that return UNKNOWN are
correctly treated as non-source.

See spring-projectsgh-50831

Signed-off-by: yangzhice <a13644015167@qq.com>
@elephant-y
elephant-y force-pushed the gh-50831-fix-indexed-binder-oom branch from ab30a70 to ccbfe7c Compare July 28, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants