Skip to content

Instantly share code, notes, and snippets.

@eishay
Created November 1, 2011 17:43
Show Gist options
  • Save eishay/1331303 to your computer and use it in GitHub Desktop.
Save eishay/1331303 to your computer and use it in GitHub Desktop.
// Code licensed under the Apache License v2.0 http://www.apache.org/licenses/LICENSE-2.0
public class AnyThrow {
public static RuntimeException uncheked(Throwable e) {
AnyThrow.<RuntimeException>throwAny(e);
return null;
}
@SuppressWarnings("unchecked")
private static <E extends Throwable> void throwAny(Throwable e) throws E {
throw (E)e;
}
}
@codingtony
Copy link

Very clever!

Is this code will be relased under APL 2.0 ?

@eishay
Copy link
Author

eishay commented Apr 10, 2012

Sure.
Code licensed under the Apache License v2.0 http://www.apache.org/licenses/LICENSE-2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment