Skip to content

Instantly share code, notes, and snippets.

@kevsmith
Created December 8, 2010 14:49
Show Gist options
  • Select an option

  • Save kevsmith/733359 to your computer and use it in GitHub Desktop.

Select an option

Save kevsmith/733359 to your computer and use it in GitHub Desktop.
/**
* Throws a checked {@link Exception} not declared in the method signature.
* Clearly, this circumvents compiler safeguards, so use with caution.
* You've been warned.
*
* @param exception
* A checked (or unchecked) exception to be thrown.
*/
public static void throwChecked(final Throwable exception) {
new CheckedThrower<RuntimeException>().throwChecked(exception);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment