There’s 2 Singleton instances, both created by Google Guice, in my application.
How’s that even possible?
The binding is done as follow:
bind(Foo.class).to(FooImpl.class).in(Scopes.SINGLETON);
The problem here was the binding declaration.
We fixed it by replacing the binding declaration to:
bind(FooImpl.class).in(Scopes.SINGLETON);
bind(Foo.class).to(FooImpl.class);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With