Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

"InjectAdapter uses unchecked or unsafe operations" when injecting parameterized type into generic class #500

Open
mattlogan opened this issue Dec 1, 2015 · 0 comments

Comments

@mattlogan
Copy link

I'm seeing the following compiler warning with field injection of a parameterized type inside a generic class:

Note: <path to generated class>/Foo$$InjectAdapter.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

As a simple example, I'm using the following generic class:

public class Foo<T> {
    @Inject Bar<Baz> bazBar;
}

And the following module:

@Module(
           injects = Foo.class
)
public class MainModule {
    @Provides Bar<Baz> provideBazBar() {
        return new Bar<>();
    }
}

To verify, clone this sample project and run ./gradlew clean compileDebugJavaWithJavac

tbroyer pushed a commit to tbroyer/dagger that referenced this issue May 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant