public void printStackTrace(PrintStream output){
synchronized (output) {
    super.printStackTrace(output);
    Throwable throwable=getException();
    if (throwable != null) {
      if (this.fileName != null) {
        output.print("Caused in ");
        output.print(this.fileName);
        output.print(" by: ");
      }
 else {
        output.print("Caused by: ");
      }
      throwable.printStackTrace(output);
    }
  }
}

public void printStackTrace ( PrintStream output ) { synchronized ( output ) { super . printStackTrace ( output ) ; Throwable throwable = getException ( ) ; if ( throwable != null ) { if ( this . fileName != null ) { output . print ( "Caused in " ) ; output . print ( this . fileName ) ; output . print ( " by: " ) ; } else { output . print ( "Caused by: " ) ; } throwable . printStackTrace ( output ) ; } } }
prints this exception ' s stack trace to the given print stream .
