MCPcopy Index your code
hub / github.com/antlr/codebuff / propagateIfInstanceOf

Method propagateIfInstanceOf

output/java_guava/1.4.17/Throwables.java:102–109  ·  view source on GitHub ↗

Propagates throwable exactly as-is, if and only if it is an instance of declaredType. Example usage: try { someMethodThatCouldThrowAnything(); } catch (IKnowWhatToDoWithThisException e) { handle(e); } catch (Throwable t) { Throwables.propagateIfInstanceOf(t, IOException.

(@Nullable Throwable throwable, Class<X> declaredType)

Source from the content-addressed store, hash-verified

100 */
101
102 @Deprecated
103 @GwtIncompatible // throwIfInstanceOf
104 public static <X extends Throwable> void propagateIfInstanceOf(@Nullable Throwable throwable, Class<X> declaredType)
105 throws X {
106 if (throwable != null) {
107 throwIfInstanceOf(throwable, declaredType);
108 }
109 }
110
111 /**
112 * Throws {@code throwable} if it is a {@link RuntimeException} or {@link Error}. Example usage:

Callers 2

getMethod · 0.95
propagateIfPossibleMethod · 0.95

Calls 1

throwIfInstanceOfMethod · 0.95

Tested by

no test coverage detected