axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis AxisFault.java
Date Fri, 02 Jul 2004 17:06:24 GMT
gawor       2004/07/02 10:06:24

  Modified:    java/src/org/apache/axis AxisFault.java
  Log:
  only add stack trace if initFromException called on itself
  
  Revision  Changes    Path
  1.89      +23 -2     ws-axis/java/src/org/apache/axis/AxisFault.java
  
  Index: AxisFault.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/AxisFault.java,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- AxisFault.java	18 May 2004 07:10:39 -0000	1.88
  +++ AxisFault.java	2 Jul 2004 17:06:24 -0000	1.89
  @@ -21,6 +21,8 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.Vector;
  +import java.io.PrintWriter;
  +import java.io.StringWriter;
   
   import javax.xml.namespace.QName;
   import javax.xml.parsers.ParserConfigurationException;
  @@ -263,8 +265,16 @@
           }
   
           //add stack trace
  -        addFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE,
  -                JavaUtils.stackToString(target));
  +        if (target == this) {
  +            // only add stack trace. JavaUtils.stackToString() call would
  +            // include dumpToString() info which is already sent as different
  +            // elements of this fault.
  +            addFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE,
  +                           getPlainStackTrace());
  +        } else {
  +            addFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE,
  +                           JavaUtils.stackToString(target));
  +        }
   
           //add the hostname
           addHostnameIfNeeded();
  @@ -752,6 +762,17 @@
        */
       public String toString() {
           return faultString;
  +    }
  +
  +    /**
  +     * Gets the stack trace as a string.
  +     */
  +    private String getPlainStackTrace() {
  +        StringWriter sw = new StringWriter(512);
  +        PrintWriter pw = new PrintWriter(sw); 
  +        super.printStackTrace(pw);
  +        pw.close();
  +        return sw.toString();
       }
   
       /**
  
  
  

Mime
View raw message