public final class Throwables extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addSuppressed(Throwable throwable,
Throwable suppressedThrowable)
Deprecated.
If compiling on Java 7 and above use
Throwable.addSuppressed(Throwable) .
Marked as deprecated because Java 6 is deprecated. Will be removed in 2.5. |
static Throwable |
getRootCause(Throwable throwable)
Returns the deepest cause of the given
throwable . |
static Throwable[] |
getSuppressed(Throwable throwable)
Deprecated.
If compiling on Java 7 and above use
Throwable.getSuppressed() . Marked as deprecated because
Java 6 is deprecated. Will be removed 2.5. |
static boolean |
isGetSuppressedAvailable()
Deprecated.
Will be removed in 2.5. As of 2.4, always returns true.
|
static void |
rethrow(Throwable t)
Rethrows a
Throwable , wrapping checked exceptions into an UndeclaredThrowableException . |
static List<String> |
toStringList(Throwable throwable)
Converts a Throwable stack trace into a List of Strings.
|
@Deprecated public static void addSuppressed(Throwable throwable, Throwable suppressedThrowable)
Throwable.addSuppressed(Throwable)
.
Marked as deprecated because Java 6 is deprecated. Will be removed in 2.5.throwable
- a ThrowablesuppressedThrowable
- a suppressed ThrowableThrowable.addSuppressed(Throwable)
public static Throwable getRootCause(Throwable throwable)
throwable
.throwable
- the throwable to navigate@Deprecated public static Throwable[] getSuppressed(Throwable throwable)
Throwable.getSuppressed()
. Marked as deprecated because
Java 6 is deprecated. Will be removed 2.5.throwable
- a ThrowableThrowable.getSuppressed()
Throwable.getSuppressed()
@Deprecated public static boolean isGetSuppressedAvailable()
public static List<String> toStringList(Throwable throwable)
throwable
- the Throwablepublic static void rethrow(Throwable t)
Throwable
, wrapping checked exceptions into an UndeclaredThrowableException
.t
- the Throwable to throw.RuntimeException
- if t
is a RuntimeExceptionError
- if t
is an ErrorUndeclaredThrowableException
- if t
is a checked ExceptionCopyright © 1999-2017 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.