Skip to content

Conversation

@nosan
Copy link
Contributor

@nosan nosan commented Aug 23, 2025

See #35369

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 23, 2025
@nosan nosan force-pushed the 35369 branch 2 times, most recently from a722667 to a596879 Compare August 23, 2025 22:25
Previously, SingletonSupplier stored "null" in singletonInstance when the supplied instance was "null". On subsequent get() calls, this was treated as "uninitialized" and triggered another attempt to obtain an instance. This commit ensures that a "null" returned from the instanceSupplier or defaultSupplier is handled correctly, so that subsequent calls to get() return "null" consistently instead of repeatedly invoking the supplier. Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
@sbrannen sbrannen self-assigned this Oct 30, 2025
@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 30, 2025
@sbrannen sbrannen added this to the 7.0.0-RC3 milestone Oct 30, 2025
@sbrannen sbrannen changed the title SingletonSupplier is not singleton if null is returned on first supplier call SingletonSupplier is not singleton if null is returned on first supplier call Oct 30, 2025
@sbrannen sbrannen closed this in a41af44 Oct 30, 2025
sbrannen added a commit that referenced this pull request Oct 30, 2025
@sbrannen
Copy link
Member

This has been merged into main in a41af44 and revised in 2d3c2e3.

Thanks

@nosan
Copy link
Contributor Author

nosan commented Oct 30, 2025

Thanks, @sbrannen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug

5 participants