Skip to content

Binding annotations aren't being consistently honored #91

@chriskessel

Description

@chriskessel

I tried to file this with Guice, but they won't look at it because I'm using Dropwizard, so maybe this is the right place?

I have two modules, each provides an instance of the same class (a specific Gson configuration). So, each module has a method like so:

@Provides
@ModuleA (this is @ModuleB in the other module)
public Gson provideGson() { ... }

Then I have constructors for classes that use those Gson items, that look like:

@Inject
public FooBar(@ModuleA gson) { ... }

This does NOT work consistently. Sometimes it injects the @moduleb version of Gson into things annotationed with @ModuleA.

I'm using Dropwizard 0.8.5 with dropwizard-guice 0.8.4 and Guice 4.1.

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