(Class<T> klass, Throwable t)
| 473 | } |
| 474 | |
| 475 | public static <T extends Throwable> T unwrapTo(Class<T> klass, Throwable t) { |
| 476 | while (t != null) { |
| 477 | if (klass.isInstance(t)) { |
| 478 | return (T) t; |
| 479 | } |
| 480 | t = t.getCause(); |
| 481 | } |
| 482 | return null; |
| 483 | } |
| 484 | |
| 485 | public static <T extends Throwable> void unwrapAndThrow(Class<T> klass, Throwable t) throws T { |
| 486 | T ret = unwrapTo(klass, t); |
no outgoing calls
no test coverage detected