Instances and providers bound with
LinkedBindingBuilder<T>.toInstance(T)/toProvider(Provider<? extends T>)
must be bound in dependency order.
Because BinderImpl.createInjector injects the members of these instances
and providers in binding order, if an earlier-bound instance/provider A
depends transitively on a later-bound instance/provider B, B may be used
before it has been injected, which may cause a NullPointerException or
other exception.
Is it possible for the binder to determine a dependency graph and then
automatically order the instances/providers whose members it injects? If
not, this dependency-order constraint should be documented.
This is related to, but different from, issue 166.
I've attached a failing test.
Original issue reported on code.google.com by net...@gmail.com on 4 Feb 2008 at 5:56
Original issue reported on code.google.com by
net...@gmail.com
on 4 Feb 2008 at 5:56Attachments: