xiaodududu / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Offer the dependency hierarchy, for debugging #631

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When debugging, it's often very useful to be able to get the current state of 
the dependency chain.  It is impossible to to this right now without changing 
one of your injectables to throw an exception (and letting Guice build up the 
chain for you, based on the state kept in the stack).

Attached is a small patch that changes InternalContext to keep a queue of its 
dependencies, so at a minimum someone using the debugger can figure out the 
chain.  A followup to this would be exposing it through something like 
com.google.inject.util.Debug.getCurrentDependencyChain(), and/or exposing it in 
the ProvisionInvocation from the patch @ issue 78.

Original issue reported on code.google.com by sberlin on 19 May 2011 at 1:28

Attachments:

GoogleCodeExporter commented 9 years ago
New patch that's incorporated with ProvisionListeners, and also reworked to 
support including linked bindings, providers, requestInjection, etc.. into the 
dependency chain.

Original comment by sberlin on 6 Jun 2011 at 1:33

Attachments:

GoogleCodeExporter commented 9 years ago
fixed in r1553

Original comment by sberlin on 12 Jun 2011 at 9:55