square/dagger — pull request #359 by cgruber (2013-11-25 17:35:16+00:00)
Title: A few more changes to eliminate reflection.

Presently ModuleAdapterProcessor generates members/foo.bar.Blah keys for non-interfaces present in the @Module(injects=...) list. This change, instead of simply saying "if class, list a members key", lists the provision key and only generates the members key if the type has injectable fields. It short circuits that logic if the type is provided in an `@Provides` method in the same module, but doesn't short circuit if the type has no `@Inject` constructor, because it may have been provided up-stream by another included module or adds-to referenced module.

In short, if the processor can see the type, and can inspect it, and it has no field injection, no members/foo key will be listed in injects. But also, if it KNOWS this type will be given through an @Provides method, it will also not list a members key. This results in a lot less unintentional reflection since dagger will not then attempt to load `InjectAdapter`s for a lot of members keys that are actually already present as provides bindings.

In practice, this was discovered by large graphs with a lot of value types being inserted into the graph and being listed as injectable, forcing a lot of reflective bindings to be created that would never ever be used (since there was no members-injection).