michaelwiles / google-gin

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

BindingResolver.describeCycle is broken #138

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Construct circular bindings
2. Resolve the Ginjector

What is the expected output? What do you see instead?

Expected output is "Circular dependency detected: ..." (BindingResolver line 
143) but instead it throws a NoSuchElementException (on line 343). That's 
because describeCycle incorrectly looks for the key using identity check rather 
than equality check. Patch attached.

What version of the product are you using? On what operating system?

r172

Please provide any additional information below.

I would like to suggest to refactor all tests as to not reuse Key instances 
like FOO, BAR, and BAZ, and instead always invoke Key.get, so that similar 
errors are not masked.

Original issue reported on code.google.com by julian...@gmail.com on 18 Feb 2011 at 5:37

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the error report! This is already being fixed, see 
http://codereview.appspot.com/4179053/ and 
http://codereview.appspot.com/4175056/ for reference.

Original comment by aragos on 18 Feb 2011 at 6:55

GoogleCodeExporter commented 9 years ago
Oh, I see. Of course support for circular dependencies is even better. Feel 
free to close this, then.

Original comment by julian...@gmail.com on 18 Feb 2011 at 9:03

GoogleCodeExporter commented 9 years ago
Should be fixed in r191.

Original comment by aragos on 4 Apr 2011 at 7:13