Skip to content

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

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

Closed
spring-projects-issues opened this issue Dec 8, 2014 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This is intentional: In XML, the list can be comma/semicolon/space/tab/linefeed-separated; in Java, due to Java source limitations, it'll effectively be comma/semicolon/space-separated. I've updated the documentation accordingly.

The goal is to leniently handle whitespace in configuration files, allowing for any custom formatting arrangement in case of longer lists.

Juergen

@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches type: documentation A documentation task in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.1.4 milestone Jan 11, 2019
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) status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

2 participants