code: public void printStackTrace(java.io.PrintStream ps) {
          if ( exception != null ) {
              String superString = getLocalMessage();
              synchronized ( ps ) {
                  ps.print(superString);
                  ps.print((superString.endsWith(".") ?
                            " Caused by " : ". Caused by "));
                  exception.printStackTrace( ps );
              }
          } else {
              super.printStackTrace( ps );
          }
      }
docs: Prints this exception's stack trace to a print stream.
  If this exception has a root exception; the stack trace of the
  root exception is printed to the print stream instead.
  @param ps The non-null print stream to which to print.