setStackTrace((StackTraceElement[]) list.toArray(new StackTraceElement[list.size()]));
    private void setScriptStack(Throwable cause) {        List list = new ArrayList();        StackTraceElement[] stack = cause.getStackTrace();        for (int i = 0; i < stack.length; i++) {            StackTraceElement e = stack[i];            String name = e.getFileName();            if (e.getLineNumber() > -1 &&                    (name.endsWith(".js") || name.endsWith(".hac"))) {                list.add(e);            }        }        setStackTrace((StackTraceElement[]) list.toArray(new StackTraceElement[list.size()]));    }