public void printStackTrace(java.io.PrintWriter pw){
  if (rootCause != null) {
    String superString=super.toString();
synchronized (pw) {
      pw.print(superString + (superString.endsWith(".") ? "" : ".") + "  Root exception is ");
      rootCause.printStackTrace(pw);
    }
  }
 else {
    super.printStackTrace(pw);
  }
}

public void printStackTrace ( java . io . PrintWriter pw ) { if ( rootCause != null ) { String superString = super . toString ( ) ; synchronized ( pw ) { pw . print ( superString + ( superString . endsWith ( "." ) ? "" : "." ) + "  Root exception is " ) ; rootCause . printStackTrace ( pw ) ; } } else { super . printStackTrace ( pw ) ; } }
prints this exception ' s stack trace to a print writer . if this exception has a root exception ; the stack trace of the root exception is printed to the print writer instead .
