Closed GoogleCodeExporter closed 9 years ago
Original comment by kevinb@google.com
on 30 Jul 2010 at 3:56
I can't conceive of a use case where this would be the proper architecture.
Assuming that MapMaker allowed recursive computation, how do you prevent
infinite recursion?
Original comment by yrfselrahc@gmail.com
on 26 Jan 2011 at 7:21
On second thought, even though the value of recursive computation is not
obvious to me, it couldn't hurt to fail fast.
Original comment by yrfselrahc@gmail.com
on 26 Jan 2011 at 7:28
One (actual live) use case is using MapMaker to create a map from class to
instance implementing the class (think service lookup). Instances may require
other instances during initialization, which would require going back to the
MapMaker. If, due to developer error, there is a circular dependency, it would
be preferable to have an exception thrown with sufficient diagnostic
information allow the developer to fix the root cause.
Original comment by ian.b.ro...@gmail.com
on 27 Jan 2011 at 12:40
1. Adding this to MapMaker would mean additional overhead for the vast majority
of uses that don't need this.
2. I haven't thought through it, but can't the user implement cycle detection
himself? Using a ThreadLocal with a stack or a set or so. (This might even
deadlock though, but it would still be an improvement).
Original comment by jim.andreou
on 27 Jan 2011 at 2:37
Original comment by kevinb@google.com
on 27 Jan 2011 at 2:08
Original comment by fry@google.com
on 8 Apr 2011 at 1:17
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:15
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:10
Original issue reported on code.google.com by
harman.p...@googlemail.com
on 14 Jun 2010 at 8:25