Skip to content

String key should be Object, cause removeSessionFactory and getSessionFactory works with Object #3169

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
kezhevatov opened this issue Feb 6, 2020 · 2 comments
Labels
ideal-for-user-contribution An issue that would ideal for a user to get started with contributing. in: file type: bug
Milestone

Comments

@kezhevatov
Copy link
Contributor

@artembilan
Copy link
Member

Wow! That's good catch!

Indeed this is a bug: all other DefaultSessionFactoryLocator contracts are based on the Object, so this addSessionFactory has to be on Object as well.

As a workaround you can fully rely on the DefaultSessionFactoryLocator(Map<Object, SessionFactory<F>> factories) constructor.

Feel free to provide a contribution: https://github.com/spring-projects/spring-integration/blob/master/CONTRIBUTING.adoc

Thanks!

@artembilan artembilan added the ideal-for-user-contribution An issue that would ideal for a user to get started with contributing. label Feb 6, 2020
@artembilan
Copy link
Member

I think for binary backward compatibility we need to deprecate an existing method and introduce a new one.
The old one will be removed in the next version.

kezhevatov added a commit to kezhevatov/spring-integration that referenced this issue Feb 6, 2020
…ctory key's type from String to Object

All other DefaultSessionFactoryLocator contracts are based on the Object, so this addSessionFactory has to be on Object as well.
kezhevatov added a commit to kezhevatov/spring-integration that referenced this issue Feb 6, 2020
…ctory key's type from String to Object

All other DefaultSessionFactoryLocator contracts are based on the Object, so this addSessionFactory has to be on Object as well.
kezhevatov added a commit to kezhevatov/spring-integration that referenced this issue Feb 6, 2020
…ctory key's type from String to Object

All other DefaultSessionFactoryLocator contracts are based on the Object, so this addSessionFactory has to be on Object as well.
kezhevatov added a commit to kezhevatov/spring-integration that referenced this issue Feb 7, 2020
…ctory key's type from String to Object

All other DefaultSessionFactoryLocator contracts are based on the Object, so this addSessionFactory has to be on Object as well.
artembilan pushed a commit that referenced this issue Feb 7, 2020
Fixes #3169

All other `DefaultSessionFactoryLocator` contracts are based on the `Object`,
so this `addSessionFactor`y has to be on `Object` as well.

* Add `DefaultSessionFactoryLocator.addSessionFactory(Object key, SessionFactory<F> factory)`
* Deprecate existing one based on `String`
* Fix tests do no use a deprecated API
* Some other code style clean up in the affected classes

**Cherry-pick to 5.2.x**

(cherry picked from commit edf84a3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ideal-for-user-contribution An issue that would ideal for a user to get started with contributing. in: file type: bug
Projects
None yet
Development

No branches or pull requests

2 participants