Here you can find the source of stackTraceToString(final StackTraceElement[] stackTrace)
public static String stackTraceToString(final StackTraceElement[] stackTrace)
//package com.java2s; //License from project: Open Source License public class Main { public static String stackTraceToString(final StackTraceElement[] stackTrace) { final StringBuilder sb = new StringBuilder(); for (final StackTraceElement stackTraceElement : stackTrace) { if (sb.length() > 0) { sb.append("\n"); }/*from w ww.j a v a 2 s. co m*/ sb.append(stackTraceElement); } return sb.toString(); } }