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
I'm seeing the following compiler warning with field injection of a parameterized type inside a generic class:
As a simple example, I'm using the following generic class:
And the following module:
To verify, clone this sample project and run
./gradlew clean compileDebugJavaWithJavac