@Test public void testPropagateIfFatalDoesNotPropagatesNormalException() throws Exception { Exception e = new Exception(); Exceptions.propagateIfFatal(e); RuntimeException re = new RuntimeException(); Exceptions.propagateIfFatal(re); Throwable t = new Throwable(); Exceptions.propagateIfFatal(t); }
public static void propagateIfFatal(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } else if (throwable instanceof Error) { throw (Error) throwable; } }
Exceptions { public static void propagateIfFatal(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } else if (throwable instanceof Error) { throw (Error) throwable; } } }
Exceptions { public static void propagateIfFatal(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } else if (throwable instanceof Error) { throw (Error) throwable; } }  }
Exceptions { public static void propagateIfFatal(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } else if (throwable instanceof Error) { throw (Error) throwable; } }  static boolean isPrefixBoring(Throwable t); static RuntimeException propagate(Throwable throwable); static RuntimeException propagate(String msg, Throwable throwable); static void propagateIfFatal(Throwable throwable); @SuppressWarnings("unchecked") static T getFirstThrowableOfType(Throwable from, Class<T> clazz); static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter); static Throwable getFirstInteresting(Throwable throwable); static Throwable collapse(Throwable source); static Throwable collapseIncludingAllCausalMessages(Throwable source); static Throwable collapse(Throwable source, boolean collapseCausalChain); static RuntimeException propagateCollapsed(Throwable source); static String collapseText(Throwable t); static String collapseTextIncludingAllCausalMessages(Throwable t); static RuntimeException propagate(Collection<? extends Throwable> exceptions); static RuntimeException propagate(String prefix, Collection<? extends Throwable> exceptions); static Throwable create(Collection<? extends Throwable> exceptions); static RuntimeException create(@Nullable String prefix, Collection<? extends Throwable> exceptions); static boolean isPrefixImportant(Throwable t); static String getPrefixText(Throwable t); }
Exceptions { public static void propagateIfFatal(Throwable throwable) { if (throwable instanceof InterruptedException) { throw new RuntimeInterruptedException((InterruptedException) throwable); } else if (throwable instanceof RuntimeInterruptedException) { Thread.currentThread().interrupt(); throw (RuntimeInterruptedException) throwable; } else if (throwable instanceof Error) { throw (Error) throwable; } }  static boolean isPrefixBoring(Throwable t); static RuntimeException propagate(Throwable throwable); static RuntimeException propagate(String msg, Throwable throwable); static void propagateIfFatal(Throwable throwable); @SuppressWarnings("unchecked") static T getFirstThrowableOfType(Throwable from, Class<T> clazz); static Throwable getFirstThrowableMatching(Throwable from, Predicate<? super Throwable> filter); static Throwable getFirstInteresting(Throwable throwable); static Throwable collapse(Throwable source); static Throwable collapseIncludingAllCausalMessages(Throwable source); static Throwable collapse(Throwable source, boolean collapseCausalChain); static RuntimeException propagateCollapsed(Throwable source); static String collapseText(Throwable t); static String collapseTextIncludingAllCausalMessages(Throwable t); static RuntimeException propagate(Collection<? extends Throwable> exceptions); static RuntimeException propagate(String prefix, Collection<? extends Throwable> exceptions); static Throwable create(Collection<? extends Throwable> exceptions); static RuntimeException create(@Nullable String prefix, Collection<? extends Throwable> exceptions); static boolean isPrefixImportant(Throwable t); static String getPrefixText(Throwable t);  }