aschuma

JAVA :: Lang :: Hide Exception

Mar 19th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.21 KB | None | 0 0
  1. public class Exceptions {
  2.   public static void rethrow (Exception e) {
  3.     Exceptions.<RuntimeException>hide(e);
  4.   }
  5.   private static <T extends Exception> void hide (Exception e) throws T {
  6.     throw (T) e;
  7.   }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment