diff options
author | mattinger <[email protected]> | 2006-07-07 14:57:32 +0000 |
---|---|---|
committer | mattinger <[email protected]> | 2006-07-07 14:57:32 +0000 |
commit | 58de8bb90188da78429eb0a30bd075430e0295c7 (patch) | |
tree | 63ce74ec7e7ee099123a4fe8ae9a8960f67eee29 /src/java/net/sf | |
parent | 855b913e7c3bf4b662beb1f97ac4980270330042 (diff) |
Fixing executing of trycatch
git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/trunk/ant-contrib@9 32d7a393-a5a9-423c-abd3-5d954feb1f2f
Diffstat (limited to 'src/java/net/sf')
-rw-r--r-- | src/java/net/sf/antcontrib/logic/TryCatchTask.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/java/net/sf/antcontrib/logic/TryCatchTask.java b/src/java/net/sf/antcontrib/logic/TryCatchTask.java index 4933e7d..11d31bf 100644 --- a/src/java/net/sf/antcontrib/logic/TryCatchTask.java +++ b/src/java/net/sf/antcontrib/logic/TryCatchTask.java @@ -197,6 +197,8 @@ public class TryCatchTask extends Task { * The heart of the task. */ public void execute() throws BuildException { + Throwable thrown = null; + if (tryTasks == null) { throw new BuildException("A nested <try> element is required"); } @@ -222,11 +224,19 @@ public class TryCatchTask extends Task { CatchBlock cb = (CatchBlock)blocks.nextElement(); executed = cb.execute(e); } + + if (! executed) { + thrown = e; + } } finally { if (finallyTasks != null) { finallyTasks.perform(); } } + + if (thrown != null) { + throw new BuildException(thrown); + } } } |