ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r568876 - /ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java
Date Thu, 23 Aug 2007 08:12:13 GMT
Author: peterreilly
Date: Thu Aug 23 01:12:13 2007
New Revision: 568876

URL: http://svn.apache.org/viewvc?rev=568876&view=rev
Log:
place the cleanup code in a finally clause

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java?rev=568876&r1=568875&r2=568876&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java Thu Aug 23 01:12:13 2007
@@ -283,17 +283,17 @@
             throw new BuildException("Could not create task of type: "
                                      + elementName, getLocation());
         }
-
-        if (realThing instanceof Task) {
-            ((Task) realThing).execute();
+        try {
+            if (realThing instanceof Task) {
+                ((Task) realThing).execute();
+            }
+        } finally {
+            // Finished executing the task, null it to allow
+            // GC do its job
+            // If this UE is used again, a new "realthing" will be made
+            realThing = null;
+            getWrapper().setProxy(null);
         }
-
-        // Finished executing the task, null it to allow
-        // GC do its job
-        // If this UE is used again, a new "realthing" will be made
-        realThing = null;
-        getWrapper().setProxy(null);
-
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message