public StackTraceElement[] getStackTrace() { return (StackTraceElement[]) getOurStackTrace().clone(); }
private synchronized StackTraceElement[] getOurStackTrace() { // Initialize stack trace if this is the first call to this method if (stackTrace == null) { int depth = getStackTraceDepth(); stackTrace = new StackTraceElement[depth]; for (int i=0; i < depth; i++) stackTrace[i] = getStackTraceElement(i); } return stackTrace; }
public static String getErrorInfoAsString(final Throwable e){ OutputStream ostr = new ByteArrayOutputStream(); e.printStackTrace(new PrintStream(ostr)); return ostr.toString(); }
public static String getStackTraceCleanVersion(final Throwable e) { String str = ""; if (e == null) return str; StackTraceElement[] t = e.getStackTrace();