Skip to content

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

Open
@einfachBlu

Description

@einfachBlu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions