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

Reason to break PropertiesFactoryBean contract from 2.5 to 3.0 [SPR-7428] #12086

Closed
spring-projects-issues opened this issue Aug 6, 2010 · 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

Stéphane Nicoll opened SPR-7428 and commented

I am wondering what the rationale would be to break PropertiesFactoryBean contract in 3.0

The protected method createInstance is now removed and since the class has only final fields, the class could just as be final as well. If that's what you intended, please make the class final but if you didn't, providing a backward compat way would be much appreciated.


Affects: 3.0.3

Referenced from: commits b054ca4

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Note that PropertiesFactoryBean's superclass, PropertiesLoaderSupport, has several non-final protected methods such as loadProperties and mergeProperties which may get overridden.

In any case, I've reintroduced the "Object createInstance()" template method in deprecated form, in addition to a non-deprecated "Properties createProperties()" template method.

The problem with createInstance() is that it returns Object. That was ok with a plain FactoryBean but not with a 3.0-style FactoryBean<Properties>. Note that createInstance() must return a Properties Object at runtime now.

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement 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 3.0.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) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants