You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by co...@apache.org on 2001/02/03 15:06:32 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant BuildException.java

conor       01/02/03 06:06:32

  Modified:    src/main/org/apache/tools/ant BuildException.java
  Log:
  Change buildException to always print nested exceptions when printing
  its stack trace. Removed the equivalent code from DefaultLogger.
  
  Submitted by:	Jesse Glick <Je...@netbeans.com>
  
  Revision  Changes    Path
  1.10      +29 -1     jakarta-ant/src/main/org/apache/tools/ant/BuildException.java
  
  Index: BuildException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/BuildException.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BuildException.java	2001/01/03 14:18:26	1.9
  +++ BuildException.java	2001/02/03 14:06:32	1.10
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights
  + * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -53,6 +53,9 @@
    */
   package org.apache.tools.ant;
   
  +
  +import java.io.*;
  +
   /**
    * Signals an error condition during a build.
    *
  @@ -161,5 +164,30 @@
        */
       public Location getLocation() {
           return location;
  +    }
  +
  +    // Override stack trace methods to show original cause:
  +    public void printStackTrace() {
  +        printStackTrace(System.err);
  +    }
  +    
  +    public void printStackTrace(PrintStream ps) {
  +        synchronized (ps) {
  +            ps.println(this);
  +            if (cause != null) {
  +                ps.println("--- Nested Exception ---");
  +                cause.printStackTrace(ps);
  +            }
  +        }
  +    }
  +    
  +    public void printStackTrace(PrintWriter pw) {
  +        synchronized (pw) {
  +            pw.println(this);
  +            if (cause != null) {
  +                pw.println("--- Nested Exception ---");
  +                cause.printStackTrace(pw);
  +            }
  +        }
       }
   }
  
  
  

Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant BuildException.java

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
>
> Did you also mean to commit a patch to DefaultLogger? If so, it got
> missed... attached for reference.
>

Hmm, not sure what happened there. I applied the patch to both files at
once but I don't know where the changes went to. They are there now.

Conor


Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant BuildException.java

Posted by Jesse Glick <Je...@netbeans.com>.
conor@apache.org wrote:
>   Modified:    src/main/org/apache/tools/ant BuildException.java
>   Log:
>   Change buildException to always print nested exceptions when printing
>   its stack trace. Removed the equivalent code from DefaultLogger.

Did you also mean to commit a patch to DefaultLogger? If so, it got
missed... attached for reference.

-Jesse

-- 
Jesse Glick   <ma...@netbeans.com>
NetBeans, Open APIs  <http://www.netbeans.org/>
tel (+4202) 3300-9161 Sun Micro x49161 Praha CR