Skip to content

Lazily instantiate default components in WebAuthnConfigurer#19038

Closed
hqqw2h-lgtm wants to merge 1 commit intospring-projects:mainfrom
hqqw2h-lgtm:gh-18585
Closed

Lazily instantiate default components in WebAuthnConfigurer#19038
hqqw2h-lgtm wants to merge 1 commit intospring-projects:mainfrom
hqqw2h-lgtm:gh-18585

Conversation

@hqqw2h-lgtm
Copy link
Copy Markdown

Summary

Avoid unnecessary instantiation of MapPublicKeyCredentialUserEntityRepository and MapUserCredentialRepository in WebAuthnConfigurer.

  • Changed Optional.orElse() to Optional.orElseGet() with method references
  • Default Map-based implementations are now only created when no bean is found in the application context
  • No behavioral change; existing tests continue to pass

Closes gh-18585

Use orElseGet() instead of orElse() for default
PublicKeyCredentialUserEntityRepository and UserCredentialRepository
so that Map-based implementations are only instantiated when no bean
is found in the application context.

Closes spring-projectsgh-18585

Signed-off-by: hanweiwei <duzielww@163.com>
Made-with: Cursor
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 4, 2026
@hqqw2h-lgtm
Copy link
Copy Markdown
Author

Closing this PR as the orElse-to-orElseGet change is already included in #19039. Keeping the changes consolidated in one PR to avoid duplication.

@hqqw2h-lgtm hqqw2h-lgtm closed this Apr 5, 2026
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.

Lazily instantiate default components in WebAuthnConfigurer

3 participants