Skip to content

Provide a method to get the original bean name from a scoped target's bean name #23514

@wilkinsona

Description

@wilkinsona

We have a case in Spring Boot's @SpyBean support where we need to get the original bean name from a scoped target. ScopedProxyUtils provides a method to go from the original to the scoped target name but not the other way around. Could such a method be added please?

For the time being, we'll probably do something like this:

if (ScopedProxyUtils.isScopedTarget(beanName)) {
	beanName = beanName.substring("scopedTarget.".length());
}

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions