Comment #6 on issue 658 by mattmccu...@google.com: Make it clear how to do an optional Injector.getInstance
http://code.google.com/p/google-guice/issues/detail?id=658
It's not obvious basically because using getInstance is a "last resort" kind of thing, and doesn't expose optional-ity.
With all due respect, I find it hard to believe that all of the references to Injector#getInstance in the Google codebase (I won't state the number here, but I'm confident you can search and get it for yourself) are cleanly avoidable. I see a number that look like framework code, and various other cases.
IMO, as long as Injector#getInstance exists, it should have feature parity with @Inject. If I prepared a patch that adds some methods for optional retrieval of instances and providers, or even just updates the javadoc with your suggestion, would you accept it?
-- You received this message because you are subscribed to the Google Groups "google-guice-dev" group. To post to this group, send email to google-guice-dev@googlegroups.com. To unsubscribe from this group, send email to google-guice-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-guice-dev?hl=en.