bodewig 00/10/12 06:38:16
Modified: src/main/org/apache/tools/ant/taskdefs/optional Script.java
Log:
Make sure a BuildException thrown inside a <script> doesn't get
wrapped into yet another BuildException.
Submitted by: Nico Seessle <[EMAIL PROTECTED]>
Revision Changes Path
1.3 +9 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/Script.java
Index: Script.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/Script.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Script.java 2000/03/19 20:27:44 1.2
+++ Script.java 2000/10/12 13:38:15 1.3
@@ -109,10 +109,16 @@
// execute the script
manager.exec(language, "<ANT>", 0, 0, script);
} catch (BSFException be) {
- Exception e = be;
+ Throwable t = be;
Throwable te = be.getTargetException();
- if (te != null && te instanceof Exception) e = (Exception) te;
- throw new BuildException(e);
+ if (te != null) {
+ if (te instanceof BuildException) {
+ throw (BuildException) te;
+ } else {
+ t = te;
+ }
+ }
+ throw new BuildException(t);
}
}