org.fest.reflect.util
Class Throwables

java.lang.Object
  extended by org.fest.reflect.util.Throwables

public final class Throwables
extends Object

Understands utility methods related to Throwables.

Since:
1.2
Author:
Alex Ruiz

Method Summary
static Throwable targetOf(Throwable t)
          Obtains the target of the given Throwable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

targetOf

public static Throwable targetOf(Throwable t)
Obtains the target of the given Throwable. If the Throwable is a InvocationTargetException, this method will return the "target exception" (not the cause.) For other Throwables, the same instance is returned unmodified.

Parameters:
t - the given Throwable.
Returns:
the target exception, if applicable. Otherwise, this method returns the same Throwable passed as argument.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.