[jdom-interest] Bug report: JDOMException.printStackTrace(PrintWriter) uses System.err

Gordon Tyler gordon.tyler at sitraka.com
Fri May 10 11:25:12 PDT 2002


The printStackTrace(PrintWrinter) method in JDOMException uses System.err to
print the "Caused by: " string when iterating through the nested exceptions.
It should use the PrintWriter parameter.

Here's patch against JDOM beta 8:

--- JDOMException.java 19 Apr 2002 22:53:33 -0000
+++ JDOMException.java 10 May 2002 18:20:05 -0000
@@ -269,7 +269,7 @@
         // Print the stack trace for each nested exception.
         while((child = getNestedException(parent)) != null) {
             if (child != null) {
-                System.err.print("Caused by: ");
+                w.print("Caused by: ");
                 child.printStackTrace(w);
                 // Any nested JDOMException will print its own children,
                 // so we need to break out of here.

Ciao,
Gordon

--
Sitraka -- the Java advantage
http://www.sitraka.com/




More information about the jdom-interest mailing list