s.println(this); StackTraceElement[] trace = getStackTrace(); for (int i=0; i < trace.length; i++) s.println("\tat " + trace[i].getFileName() + ":" + trace[i].getLineNumber()); Throwable ourCause = getCause(); if (ourCause != null) printStackTraceAsCause(ourCause, s, trace);
if (scriptStack != null) { s.println(this); s.print(scriptStack); s.print("Full trace: "); } getCause().printStackTrace(s);
    public void printStackTrace(PrintStream s) {        synchronized (s) {            s.println(this);            StackTraceElement[] trace = getStackTrace();            for (int i=0; i < trace.length; i++)                s.println("\tat " + trace[i].getFileName() + ":" +                                    trace[i].getLineNumber());            Throwable ourCause = getCause();            if (ourCause != null)                printStackTraceAsCause(ourCause, s, trace);        }    }