Skip to content

Instantly share code, notes, and snippets.

@axiak
Created November 13, 2013 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axiak/7455969 to your computer and use it in GitHub Desktop.
Save axiak/7455969 to your computer and use it in GitHub Desktop.
// All over the place
if (maybeWidget.isPresent()) {
return maybeWidget.get();
} else {
throw new WidgetNotFoundException(id);
}
// Maybe instead?
return maybeWidget.orThrow(new WidgetNotFoundException(id));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment