ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r834354 - in /ant/core/trunk: CONTRIBUTORS WHATSNEW contributors.xml src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java
Date Tue, 10 Nov 2009 05:28:46 GMT
Author: bodewig
Date: Tue Nov 10 05:28:45 2009
New Revision: 834354

URL: http://svn.apache.org/viewvc?rev=834354&view=rev
Log:
All instances of the same scriptdef task shared a single ScriptRunner, causing problems in
multithreaded situations.  Submitted by Valentino Miazzo.  PR 41602

Modified:
    ant/core/trunk/CONTRIBUTORS
    ant/core/trunk/WHATSNEW
    ant/core/trunk/contributors.xml
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java

Modified: ant/core/trunk/CONTRIBUTORS
URL: http://svn.apache.org/viewvc/ant/core/trunk/CONTRIBUTORS?rev=834354&r1=834353&r2=834354&view=diff
==============================================================================
Binary files - no diff available.

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=834354&r1=834353&r2=834354&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Nov 10 05:28:45 2009
@@ -526,6 +526,10 @@
    compatibility to Ant 1.7.0.
    Bugzilla Report 48040.
 
+ * different task instances of the same <scriptdef>ed tasks could
+   overwrite each others attributes/nested elements.
+   Bugzilla Report 41602.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/contributors.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/contributors.xml?rev=834354&r1=834353&r2=834354&view=diff
==============================================================================
--- ant/core/trunk/contributors.xml (original)
+++ ant/core/trunk/contributors.xml Tue Nov 10 05:28:45 2009
@@ -1354,6 +1354,10 @@
     <last>Schmidt</last>
   </name>
   <name>
+    <first>Valentino</first>
+    <last>Miazzo</last>
+  </name>
+  <name>
     <first>Victor</first>
     <last>Toni</last>
   </name>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java?rev=834354&r1=834353&r2=834354&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java Tue
Nov 10 05:28:45 2009
@@ -50,11 +50,6 @@
      * script runner helper
      */
     private ScriptRunnerHelper helper = new ScriptRunnerHelper();
-    /**
-     * script runner.
-     */
-    /** Used to run the script */
-    private ScriptRunnerBase   runner = null;
 
     /** the name by which this script will be activated */
     private String name;
@@ -203,9 +198,6 @@
             helper.setClassLoader(createLoader());
         }
 
-        // Now create the scriptRunner
-        runner = helper.getScriptRunner();
-
         attributeSet = new HashSet();
         for (Iterator i = attributes.iterator(); i.hasNext();) {
             Attribute attribute = (Attribute) i.next();
@@ -348,6 +340,7 @@
      * @param instance   the script instance; can be null
      */
     public void executeScript(Map attributes, Map elements, ScriptDefBase instance) {
+        ScriptRunnerBase runner = helper.getScriptRunner();
         runner.addBean("attributes", attributes);
         runner.addBean("elements", elements);
         runner.addBean("project", getProject());



Mime
View raw message