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

strange issue with different imports from javax and google guice #1841

Open
einfachBlu opened this issue Nov 2, 2024 · 0 comments
Open

strange issue with different imports from javax and google guice #1841

einfachBlu opened this issue Nov 2, 2024 · 0 comments

Comments

@einfachBlu
Copy link

I have noticed that when i use

@com.google.inject.Singleton

on a Class, it will be somehow inject a different instance than when i do the javax import of it.

So Class1 has the google Singleton import and has: "@Inject Class3". Class 3 would be "instance1"
and Class2 has the javax Singleton import and has: "@Inject Class3". Class 3 would be "instance2"

Maybe it is intentional but from what i saw in several docs, it should inject the same thing. (yes it is singleton). Same result when i call a method on both classes and use 3x "injector.getInstance(Class3.class), it would return the singleton but would somehow create one instance per javax and one per google import

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

No branches or pull requests

1 participant