@GwtCompatible
public class Exceptions
extends java.lang.Object
Constructor and Description |
---|
Exceptions() |
Modifier and Type | Method and Description |
---|---|
static java.lang.RuntimeException |
sneakyThrow(java.lang.Throwable t)
Throws the given exception and sneaks it through any compiler checks.
|
public static java.lang.RuntimeException sneakyThrow(java.lang.Throwable t)
throw sneakyThrow(new CheckedException("Catch me if you can ;-)")).This method is heavily inspired by project Lombok.
t
- the throwable that should be sneaked through compiler checks. May not be null
.t
is always thrown.java.lang.NullPointerException
- if t
is null
.