ThrowUnchecked insteadpublic abstract class ThrowUnchecked
extends java.lang.Object
Example:
public <E extends Throwable> void someMethod(E exception) throws E {
...
// Apparent compiler bug sometimes disallows this. Doesn't appear to
// show up when compiling source files individually.
//throw exception;
// Throw it this way instead, and compiler doesn't know.
ThrowUnchecked.fire(exception);
}
| Modifier | Constructor and Description |
|---|---|
protected |
ThrowUnchecked()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doFire(java.lang.Throwable t)
Deprecated.
|
static void |
fire(java.lang.Throwable t)
Deprecated.
Throws the given exception, even though it may be checked.
|
static void |
fireCause(java.lang.Throwable t)
Deprecated.
Throws the cause of the given exception, even though it may be
checked.
|
static void |
fireDeclared(java.lang.Throwable t,
java.lang.Class... declaredTypes)
Deprecated.
Throws the given exception if it is unchecked or an instance of any of
the given declared types.
|
static void |
fireDeclaredCause(java.lang.Throwable t,
java.lang.Class... declaredTypes)
Deprecated.
Throws the cause of the given exception if it is unchecked or an
instance of any of the given declared types.
|
static void |
fireDeclaredRootCause(java.lang.Throwable t,
java.lang.Class... declaredTypes)
Deprecated.
Throws the root cause of the given exception if it is unchecked or an
instance of any of the given declared types.
|
static void |
fireFirstDeclared(java.lang.Throwable t,
java.lang.Class... declaredTypes)
Deprecated.
Throws the either the original exception or the first found cause if it
matches one of the given declared types or is unchecked.
|
static void |
fireFirstDeclaredCause(java.lang.Throwable t,
java.lang.Class... declaredTypes)
Deprecated.
Throws the first found cause that matches one of the given declared
types or is unchecked.
|
static void |
fireRootCause(java.lang.Throwable t)
Deprecated.
Throws the root cause of the given exception, even though it may be
checked.
|
public static void fire(java.lang.Throwable t)
t - exception to throwpublic static void fireDeclared(java.lang.Throwable t,
java.lang.Class... declaredTypes)
t - exception to throwdeclaredTypes - if exception is checked and is not an instance of
any of these types, then it is thrown as an
UndeclaredThrowableException.public static void fireFirstDeclared(java.lang.Throwable t,
java.lang.Class... declaredTypes)
t - exception whose cause is to be throwndeclaredTypes - if exception is checked and is not an instance of
any of these types, then it is thrown as an
UndeclaredThrowableException.public static void fireCause(java.lang.Throwable t)
t - exception whose cause is to be thrownpublic static void fireDeclaredCause(java.lang.Throwable t,
java.lang.Class... declaredTypes)
t - exception whose cause is to be throwndeclaredTypes - if exception is checked and is not an instance of
any of these types, then it is thrown as an
UndeclaredThrowableException.public static void fireFirstDeclaredCause(java.lang.Throwable t,
java.lang.Class... declaredTypes)
t - exception whose cause is to be throwndeclaredTypes - if exception is checked and is not an instance of
any of these types, then it is thrown as an
UndeclaredThrowableException.public static void fireRootCause(java.lang.Throwable t)
t - exception whose root cause is to be thrownpublic static void fireDeclaredRootCause(java.lang.Throwable t,
java.lang.Class... declaredTypes)
t - exception whose root cause is to be throwndeclaredTypes - if exception is checked and is not an instance of
any of these types, then it is thrown as an
UndeclaredThrowableException.protected abstract void doFire(java.lang.Throwable t)
Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.