From c97b3c60d5aaee0ed321880b2f7876ba0d97f1e3 Mon Sep 17 00:00:00 2001 From: Kevin Jackson Date: Fri, 18 May 2007 08:58:19 +0000 Subject: [PATCH] -javadoc and break if the task executes cleanly git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@539329 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/taskdefs/Retry.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Retry.java b/src/main/org/apache/tools/ant/taskdefs/Retry.java index de34cbb25..9d783460a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Retry.java +++ b/src/main/org/apache/tools/ant/taskdefs/Retry.java @@ -17,9 +17,6 @@ */ package org.apache.tools.ant.taskdefs; -import java.util.Enumeration; -import java.util.Vector; - import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; @@ -30,22 +27,39 @@ import org.apache.tools.ant.TaskContainer; */ public class Retry extends Task implements TaskContainer { + /** + * task to execute n times + */ private Task nestedTask; - private int retryCount; + /** + * set retryCount to 1 by default + */ + private int retryCount = 1; + /** + * set the task + */ public void addTask(Task t) { nestedTask = t; } + /** + * set the number of times to retry the task + * @param n + */ public void setRetryCount(int n) { retryCount = n; } + /** + * perform the work + */ public void execute() throws BuildException { for(int i=0; i<=retryCount; i++) { try { nestedTask.perform(); + break; } catch (Exception e) { if (i