@@ -0,0 +1,1775 @@
+//%0A// DebugTools.java%0A//%0A%0A/*%0ALOCI Common package: utilities for I/O, reflection and miscellaneous tasks.%0ACopyright (C) 2005-@year@ Melissa Linkert, Curtis Rueden and Chris Allan.%0A%0AThis program is free software; you can redistribute it and/or modify%0Ait under the terms of the GNU General Public License as published by%0Athe Free Software Foundation; either version 2 of the License, or%0A(at your option) any later version.%0A%0AThis program is distributed in the hope that it will be useful,%0Abut WITHOUT ANY WARRANTY; without even the implied warranty of%0AMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0AGNU General Public License for more details.%0A%0AYou should have received a copy of the GNU General Public License%0Aalong with this program; if not, write to the Free Software%0AFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA%0A*/%0A%0Apackage loci.common;%0A%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.PrintStream;%0A%0A/**%0A * A utility class with convenience methods for debugging.%0A *%0A * %3Cdl%3E%3Cdt%3E%3Cb%3ESource code:%3C/b%3E%3C/dt%3E%0A * %3Cdd%3E%3Ca href=%22https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/common/src/loci/common/DebugTools.java%22%3ETrac%3C/a%3E,%0A * %3Ca href=%22https://skyking.microscopy.wisc.edu/svn/java/trunk/components/common/src/loci/common/DebugTools.java%22%3ESVN%3C/a%3E%3C/dd%3E%3C/dl%3E%0A *%0A * @author Curtis Rueden ctrueden at wisc.edu%0A */%0Apublic final class DebugTools %7B%0A%0A  // -- Constructor --%0A%0A  private DebugTools() %7B %7D%0A%0A  // -- DebugTools methods --%0A%0A  /** Extracts the given exception's corresponding stack trace to a string. */%0A  public static String getStackTrace(Throwable t) %7B%0A    ByteArrayOutputStream out = new ByteArrayOutputStream();%0A    t.printStackTrace(new PrintStream(out));%0A    return new String(out.toByteArray());%0A  %7D%0A%0A%7D%0A

Add utility method for extracting a stack trace string from an exception.