Here you can find the source of dumpStack(boolean exit)
public static void dumpStack(boolean exit)
//package com.java2s; import java.io.PrintWriter; import java.io.StringWriter; public class Main { public static void dumpStack(boolean exit) { try {//from ww w.j a v a 2 s.com throw new Exception("Dumping stack:"); } catch (Exception e) { e.printStackTrace(); //if(exit) // System.exit(0); } } /** * Use with caution: lots of overhead */ public static String printStackTrace(Throwable t) { StringWriter s = new StringWriter(); PrintWriter p = new PrintWriter(s); t.printStackTrace(p); return s.toString(); } }