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

Fix configuration class overriden/overloaded methods issues (SPR-10992, SPR-10988) #398

Closed
wants to merge 1 commit into from

Conversation

chelu
Copy link

@chelu chelu commented Oct 30, 2013

When adding bean methods from a configuration class,
overridden methods from superclass are added too and
it's bean definition overrides those declared in the subclass.

The fix add a new method, getBeanMethodsToDefine that filter
overriden methods for use in ConfigurationClassBeanDefinitionReader

When overloading methods from a configuration class, the most
specific subclass bean method is invoked only if

  • Argument types has the best match
  • Overloaded method in subclass has the same number of arguments.

The fix sets the factory method to use from beanMethod metadata to
RootBeanDefinition.resolvedConstructorOrFactoryMethod in
ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod()
to avoid looking for appropiate factory method in ConstructorResolver later.

This pull request already includes changes from #390

Issues: SPR-10992, SPR-10988

When adding bean methods from a configuration class,
overridden methods from superclass are added too and
it's bean definition overrides those declared in the subclass.

The fix add a new method, getBeanMethodsToDefine that filter
overriden methods for use in ConfigurationClassBeanDefinitionReader

When overloading methods from a configuration class, the most
specific subclass bean method is invoked only if

- Argument types has the best match
- Overloaded method in subclass has the same number of arguments.

The fix sets the factory method to use from beanMethod metadata to
RootBeanDefinition.resolvedConstructorOrFactoryMethod in
ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod()
to avoid looking for appropiate factory method in ConstructorResolver.

Issues: SPR-10992, SPR-10988
@chelu chelu closed this Nov 4, 2013
@chelu
Copy link
Author

chelu commented Nov 4, 2013

Closed as both issues are now resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant