Update of /cvsroot/xdoclet/xdoclet2/core/src/java/xdoclet In directory sc8-pr-cvs1:/tmp/cvs-serv17057/core/src/java/xdoclet
Modified Files: XDocletException.java Log Message: Added support for JDK 1.3. Index: XDocletException.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet2/core/src/java/xdoclet/XDocletException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** XDocletException.java 8 Nov 2002 02:26:06 -0000 1.2 --- XDocletException.java 22 Nov 2002 14:30:40 -0000 1.3 *************** *** 3,8 **** --- 3,12 ---- * All rights reserved. */ + package xdoclet; + import java.io.PrintStream; + import java.io.PrintWriter; + /** * @author <a href="mailto:[EMAIL PROTECTED]">Aslak Hellesøy</a> *************** *** 10,28 **** * @version $Revision$ */ ! public class XDocletException ! extends Exception { ! public XDocletException(String msg) ! { ! super(msg); } /** * ! * @todo find a workaround to support JDK 1.3 here ! * @param t nested throwable */ ! public XDocletException(String msg, Throwable t) { ! super(msg, t); } } --- 14,107 ---- * @version $Revision$ */ ! public class XDocletException extends Exception { ! /** ! * The wrapped <code>Throwable</code>. This Throwable can be ! * retrieved by using getRootCause(). ! * ! * @see #getCause() ! */ ! protected Throwable cause = null; ! ! /** ! * Constructs a new instance of XDocletException. ! * The root exception and the detailed message are null. ! */ ! public XDocletException() { ! super(); ! } ! ! /** ! * Constructs a new instance of XDocletException ! * ! * @param s String message indicating the problem that occurred. ! */ ! public XDocletException(String s) { ! super(s); ! } ! ! /** ! * If there is a root cause, the message associated with the root ! * Exception is appended (separated by a ":"). ! * ! * @param s String message indicating the problem that occurred. ! * @param cause Throwable that caused this to be thrown. ! */ ! public XDocletException(String s, Throwable cause) { ! super(s + (s != null && !s.equals(cause.getMessage()) ? ": " + cause.getMessage() : "")); ! this.cause = cause; } /** + * This will return the root cause Throwable, or null if one does not exist. * ! * @returns the wrapped Throwable ! */ ! public Throwable getCause() { ! return cause; ! } ! ! /** ! * This prints the stack trace of the Exception. If there is a root cause, ! * the stack trace of the root Exception is printed right after. ! */ ! public void printStackTrace() { ! super.printStackTrace(); ! if (cause != null) { ! synchronized(System.err) { ! System.err.println("\nRoot cause: "); ! cause.printStackTrace(); ! } ! } ! } ! ! /** ! * This prints the stack trace of the Exception to the given PrintStream. ! * If there is a root cause, the stack trace of the root Exception is ! * printed right after. ! */ ! public void printStackTrace(PrintStream s) { ! super.printStackTrace(s); ! if (cause != null) { ! synchronized(s) { ! s.println("\nRoot cause: "); ! cause.printStackTrace(s); ! } ! } ! } ! ! /** ! * This prints the stack trace of the Exception to the given PrintWriter. ! * If there is a root cause, the stack trace of the root Exception is ! * printed right after. */ ! public void printStackTrace(PrintWriter s) { ! super.printStackTrace(s); ! if (cause != null) { ! synchronized(s) { ! s.println("\nRoot cause: "); ! cause.printStackTrace(s); ! } ! } } } ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel