You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I'm seeing is that one of these sets non-deterministically gets injected to both resource classes. E.g., the foo things end up in FooResource and BarResource, or vice-versa.
I have tried using the @Named binding annotation as well, with the same results. I have another multi-binding that uses different types instead binding annotations, and it is working fine.
I'll try to come up with a test case later today/this week as time allows. I've worked around this for now by creating separate sub-types for the foo/bar things.
The text was updated successfully, but these errors were encountered:
It's very unlikely this is a bug, since this is pretty fundamental and many things would be broken if this were broken. Please come up with a test case where you can reproduce and I'll take a look.
@sameb that was my initial thought as well. I put together a test case anyways and cannot reproduce the problem. My application is using Jersey 2.x (which uses HK2) and the jersey2-guice module from Squarespace, so I'm guessing something is not getting properly translated in the guice -> hk2 bridge.
I have two modules that bind a set of strings like:
In FooModule:
And something similar in BarModule. Then elsewhere in the code I get these sets injected like:
and something similar in BarResource.
What I'm seeing is that one of these sets non-deterministically gets injected to both resource classes. E.g., the foo things end up in FooResource and BarResource, or vice-versa.
I have tried using the
@Named
binding annotation as well, with the same results. I have another multi-binding that uses different types instead binding annotations, and it is working fine.I'll try to come up with a test case later today/this week as time allows. I've worked around this for now by creating separate sub-types for the foo/bar things.
The text was updated successfully, but these errors were encountered: