diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d7932b8b5..720327c80 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -334,6 +334,7 @@ Tom May Tomasz Bech Trejkaz Xaoza Ulrich Schmidt +Valentino Miazzo Victor Toni Vincent Legoll Waldek Herka diff --git a/WHATSNEW b/WHATSNEW index fb1e5bd72..e711a660d 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -526,6 +526,10 @@ Fixed bugs: compatibility to Ant 1.7.0. Bugzilla Report 48040. + * different task instances of the same ed tasks could + overwrite each others attributes/nested elements. + Bugzilla Report 41602. + Other changes: -------------- diff --git a/contributors.xml b/contributors.xml index d17d0b766..0dabc047d 100644 --- a/contributors.xml +++ b/contributors.xml @@ -1353,6 +1353,10 @@ Ulrich Schmidt + + Valentino + Miazzo + Victor Toni diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java b/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java index 210ff21ed..62f1222c1 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java @@ -50,11 +50,6 @@ public class ScriptDef extends DefBase { * 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 @@ public class ScriptDef extends DefBase { 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 @@ public class ScriptDef extends DefBase { * @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());