Skip to content

I can use ';' and EOL for delimiter of base-package attribute(component scan) [SPR-12523] #17128

Closed
@spring-projects-issues

Description

@spring-projects-issues

Masahiko Kudo opened SPR-12523 and commented

Document say "Alternatively, you can specify a comma-separated list that includes the parent package of each class.", but I can use ';' and EOL for delimiter of base-package attribute.

Like

<context:component-scan base-package="org.springframework.jira;org.springframework.ticket" />

It is not so bad.

But I found ComponentScanBeanDefinitionParser use ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS as delimiters.(at ComponentScanBeanDefinitionParser#parse)
CONFIG_LOCATION_DELIMITERS is ",; \t\n", then I can use ';' and EOL as delimiter.

It looks evil...CONFIG_LOCATION_DELIMITERS says it is "Any number of these characters are considered delimiters between multiple context config paths in a single String value."

Please make other const for ComponentScan.
And decide extends or fix specification of delimiter.


Affects: 4.0.8, 4.1.2

Referenced from: commits 6f2de28, 39fbfbd

Backported to: 4.0.9

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions