dagger icon indicating copy to clipboard operation
dagger copied to clipboard

@Module.injects + concrete types + @Provides

Open gk5885 opened this issue 11 years ago • 0 comments

Say I have:

final class Foo {}

And a module that looks like the following:

@Module(injects = Foo.class)
final class FooModule {
  @Provides Foo provideFoo() {
    return new Foo();
    }
}

The generated module adapter will have the following line:

private static final String[] INJECTS = { "members/Foo" };

While in practice this binding won't be exercised, a no-op binding is being created using ReflectiveAtInjectBinding. All of that unnecessary reflection has been found to be expensive in some applications.

gk5885 avatar Nov 20 '13 15:11 gk5885