Comment #11 on issue 658 by [email protected]: Make it clear how to do an optional Injector.getInstance
http://code.google.com/p/google-guice/issues/detail?id=658

I think you just want to catch the exception. Its like four lines of code and it'll potentially run much faster than getExistingBindings, which needs O(N) time+space and will be flaky if you need a JIt binding in your result.

  try {
    return injector.getInstance(key);
  } catch(ConfigurationException ignored) {}



--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to