Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish use getBeanProvider instead of getBeanNamesForType and getBean #15950

Closed
wants to merge 1 commit into from

Conversation

kse-music
Copy link
Contributor

  1. Use getBeanProvider instead of the similar code below
	if (this.context.getBeanNamesForType(A.class).length > 0) {
		this.bearerTokenResolver = this.context.getBean(A.class);
	}
	else {
		this.bearerTokenResolver = new A();
	}
  1. In addition, also can avoid run error when define multiple Bean in contexts

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 18, 2024
@kse-music kse-music closed this Oct 18, 2024
@kse-music kse-music deleted the p4 branch October 18, 2024 08:28
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