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

PropertyOverrideConfigurer ignores some invalid keys but not others [SPR-5792] #10462

Closed
spring-projects-issues opened this issue May 28, 2009 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented May 28, 2009

Rob Hasselbaum opened SPR-5792 and commented

JavaDoc for PropertyOverrideConfigurer.setIgnoreInvalidKeys states: "If you ignore invalid keys, keys that do not follow the 'beanName.property' format will just be logged as warning. This allows [one] to have arbitrary other keys in a properties file." This isn't quite complete and accurate, though. Specifically:

(a) Some keys that DO follow the 'beanName.property' format are also ignored. Specifically, if the bean name does not exist, it will be ignored.

(b) If the bean name does exist, but the property doesn't exist or is not writable, an exception is thrown even if ignore invalid keys is set to true. This means you cannot have arbitrary other keys in the properties file.

One could address these points by clarifying the documentation, but I think there's a code problem here, too, because when I set ignore invalid keys to true, I'm expecting the configurer to ignore ALL invalid keys including those that match on the bean name but not on the property. So I propose changing the code to address that case and updating the JavaDoc accordingly.


Affects: 2.5.6

Issue Links:

Referenced from: commits ad492e9

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good point! Finally addressed in 3.0 RC1.

Juergen

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) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants