ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r539329 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Retry.java
Date Fri, 18 May 2007 08:58:20 GMT
Author: kevj
Date: Fri May 18 01:58:19 2007
New Revision: 539329

URL: http://svn.apache.org/viewvc?view=rev&rev=539329
Log:
-javadoc and break if the task executes cleanly

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Retry.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Retry.java?view=diff&rev=539329&r1=539328&r2=539329
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Retry.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Retry.java Fri May 18 01:58:19 2007
@@ -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 @@
  */
 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<retryCount) {
                     log("Attempt ["+i+"] error occured, retrying...", e, Project.MSG_INFO);



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


Mime
View raw message