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

Method throwIfUnchecked

output/java_guava/1.4.17/Throwables.java:132–140  ·  view source on GitHub ↗

Throws throwable if it is a RuntimeException or Error. Example usage: for (Foo foo : foos) { try { foo.bar(); } catch (RuntimeException | Error t) { failure = t; } } if (failure != null) { throwIfUnchecked(failure); throw new AssertionError(failure);

(Throwable throwable)

Source from the content-addressed store, hash-verified

130
131
132 public static void throwIfUnchecked(Throwable throwable) {
133 checkNotNull(throwable);
134 if (throwable instanceof RuntimeException) {
135 throw (RuntimeException) throwable;
136 }
137 if (throwable instanceof Error) {
138 throw (Error) throwable;
139 }
140 }
141
142 /**
143 * Propagates {@code throwable} exactly as-is, if and only if it is an instance of

Callers 3

propagateIfPossibleMethod · 0.95
propagateMethod · 0.95
runMethod · 0.45

Calls 1

checkNotNullMethod · 0.45

Tested by

no test coverage detected