You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@locus.apache.org on 2000/09/18 17:38:39 UTC

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

bodewig     00/09/18 08:38:38

  Modified:    src/main/org/apache/tools/ant Target.java
  Log:
  Only set location in BuildException if the task didn't provide it
  before.
  
  This will give the correct location for errors in build files invoked
  via the <ant> task.
  
  Revision  Changes    Path
  1.12      +4 -1      jakarta-ant/src/main/org/apache/tools/ant/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Target.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Target.java	2000/09/18 14:04:53	1.11
  +++ Target.java	2000/09/18 15:38:38	1.12
  @@ -144,7 +144,10 @@
   		}
                   catch(RuntimeException exc) {
                       if (exc instanceof BuildException) {
  -                        ((BuildException)exc).setLocation(task.getLocation());
  +                        BuildException be = (BuildException) exc;
  +                        if (be.getLocation() == Location.UNKNOWN_LOCATION) {
  +                            be.setLocation(task.getLocation());
  +                        }
                       }
                       project.fireTaskFinished(task, exc);
                       throw exc;