@Test public void testRootStackTrace() { ArrayStoreException arithmeticException = new ArrayStoreException("This is a an ArrayStore Exception"); String actual = ExceptionUtil.rootStackTrace(arithmeticException); assertNotNull(actual); assertTrue(actual.contains("This is a an ArrayStore Exception")); }
public static String rootStackTrace(Throwable t) { t = rootOf(t); StringBuilder sb = new StringBuilder(6000); sb.append(t.toString()); for (StackTraceElement e : t.getStackTrace()) { sb.append("\nat "); sb.append(e.getClassName()).append('.').append(e.getMethodName()); sb.append('(').append(e.getFileName()); sb.append(':').append(e.getLineNumber()).append(')'); } return sb.toString(); }
ExceptionUtil { public static String rootStackTrace(Throwable t) { t = rootOf(t); StringBuilder sb = new StringBuilder(6000); sb.append(t.toString()); for (StackTraceElement e : t.getStackTrace()) { sb.append("\nat "); sb.append(e.getClassName()).append('.').append(e.getMethodName()); sb.append('(').append(e.getFileName()); sb.append(':').append(e.getLineNumber()).append(')'); } return sb.toString(); } }
ExceptionUtil { public static String rootStackTrace(Throwable t) { t = rootOf(t); StringBuilder sb = new StringBuilder(6000); sb.append(t.toString()); for (StackTraceElement e : t.getStackTrace()) { sb.append("\nat "); sb.append(e.getClassName()).append('.').append(e.getMethodName()); sb.append('(').append(e.getFileName()); sb.append(':').append(e.getLineNumber()).append(')'); } return sb.toString(); }  }
ExceptionUtil { public static String rootStackTrace(Throwable t) { t = rootOf(t); StringBuilder sb = new StringBuilder(6000); sb.append(t.toString()); for (StackTraceElement e : t.getStackTrace()) { sb.append("\nat "); sb.append(e.getClassName()).append('.').append(e.getMethodName()); sb.append('(').append(e.getFileName()); sb.append(':').append(e.getLineNumber()).append(')'); } return sb.toString(); }  static Throwable rootOf(Throwable t); static String rootStackTrace(Throwable t); static RuntimeException smash(Throwable t); }
ExceptionUtil { public static String rootStackTrace(Throwable t) { t = rootOf(t); StringBuilder sb = new StringBuilder(6000); sb.append(t.toString()); for (StackTraceElement e : t.getStackTrace()) { sb.append("\nat "); sb.append(e.getClassName()).append('.').append(e.getMethodName()); sb.append('(').append(e.getFileName()); sb.append(':').append(e.getLineNumber()).append(')'); } return sb.toString(); }  static Throwable rootOf(Throwable t); static String rootStackTrace(Throwable t); static RuntimeException smash(Throwable t);  }