Skip to content

Compare config tree values by content on refresh - #1741

Open
arimu1 wants to merge 1 commit into
spring-cloud:mainfrom
arimu1:fix/1687-configtree-refresh-equals
Open

Compare config tree values by content on refresh#1741
arimu1 wants to merge 1 commit into
spring-cloud:mainfrom
arimu1:fix/1687-configtree-refresh-equals

Conversation

@arimu1

@arimu1 arimu1 commented Sep 12, 2026

Copy link
Copy Markdown

Summary

  • Fix change detection in ContextRefresher when the environment uses Spring Boot ConfigTreePropertySource.
  • ConfigTreePropertySource.Value (including PropertyFileContent) does not implement equals/hashCode, so every refresh incorrectly reported all config tree keys as changed.
  • Compare config tree property values by content via CharSequence/toString() instead of reference equality.

Fixes gh-1687

Test plan

  • ./mvnw -pl spring-cloud-context -am test
  • Added ContextRefresherConfigTreeTests covering unchanged config tree refresh (no spurious keys) and changed content (key reported).

ContextRefresher used reference equality for property changes, so
ConfigTreePropertySource values were always reported as changed.

Fixes spring-cloudgh-1687

Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change detection on refreshEnvironment not working properly with configtree

2 participants