diff --git a/docs/index.html b/docs/index.html index 8dd13ffd6..c04ef17f2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6205,7 +6205,11 @@ output.
  • All attributes of all child elements get set via their corresponding setXXX methods - at runtime.
  • -
  • execute() is called at runtime.
  • +
  • execute() is called at runtime. While the above initialization + steps only occur once, the execute() method may be + called more than once, if the task is invoked more than once. For example, + if target1 and target2 both depend on target3, then running + "ant target1 target2" will run all tasks in target3 twice.
  • Example

    diff --git a/src/main/org/apache/tools/ant/Task.java b/src/main/org/apache/tools/ant/Task.java index 6ea82ac7e..563eb863e 100644 --- a/src/main/org/apache/tools/ant/Task.java +++ b/src/main/org/apache/tools/ant/Task.java @@ -168,18 +168,21 @@ public abstract class Task { } /** - * Called by the project to let the task initialize properly. Normally it does nothing. + * Called by the project to let the task initialize properly. * * @throws BuildException if someting goes wrong with the build */ public void init() throws BuildException {} /** - * Called by the project to let the task do it's work. Normally it does nothing. + * Called by the project to let the task do it's work. This method may be + * called more than once, if the task is invoked more than once. For example, + * if target1 and target2 both depend on target3, then running + * "ant target1 target2" will run all tasks in target3 twice. * * @throws BuildException if someting goes wrong with the build */ - public void execute() throws BuildException {}; + public void execute() throws BuildException {} /** * Returns the file location where this task was defined.