@Test public void testGetRootCause() { assertNull(getRootCause(null)); Throwable root = new Throwable(); assertSame(root, getRootCause(root)); Exception mid = new Exception(root); assertSame(root, getRootCause(mid)); RuntimeException top = new RuntimeException(mid); assertSame(root, getRootCause(top)); }
public static Throwable getRootCause(Throwable t) { if (t == null) { return t; } while (t.getCause() != null) { t = t.getCause(); } return t; }
ExceptionUtils { public static Throwable getRootCause(Throwable t) { if (t == null) { return t; } while (t.getCause() != null) { t = t.getCause(); } return t; } }
ExceptionUtils { public static Throwable getRootCause(Throwable t) { if (t == null) { return t; } while (t.getCause() != null) { t = t.getCause(); } return t; } private  ExceptionUtils(); }
ExceptionUtils { public static Throwable getRootCause(Throwable t) { if (t == null) { return t; } while (t.getCause() != null) { t = t.getCause(); } return t; } private  ExceptionUtils(); static Throwable getRootCause(Throwable t); }
ExceptionUtils { public static Throwable getRootCause(Throwable t) { if (t == null) { return t; } while (t.getCause() != null) { t = t.getCause(); } return t; } private  ExceptionUtils(); static Throwable getRootCause(Throwable t);  }