src/org/kocakosm/pitaya/util/Throwables.java
public static Throwable getRootCause(Throwable t)
	{
		Throwable cause = t.getCause();
		return cause == null ? t : getRootCause(cause);
	}
public static Throwable getRootCause(Throwable t)
	{
		Throwable cause = t.getCause();
		return cause == null ? t : getRootCause(cause);
	}
public static Throwable getRootCause ( Throwable t ) { Throwable cause = t . getCause ( ) ; return cause == null ? t : getRootCause ( cause ) ; }
Returns the root cause of the given {@code Throwable}. If the given
{@code Throwable} is not the result of a previous one, it is
considered as the root.

@param t the {@code Throwable} to get the root cause.

@return the root cause of the given {@code Throwable}.

@throws NullPointerException if {@code t} is {@code null}.
Returns the root cause of the given { @code Throwable } . If the given { @code Throwable } is not the result of a previous one it is considered as the root .