Repository: ant
Updated Branches:
  refs/heads/master 1de4dfa58 -> b30a636ed


<get>'s retries attribute has a misleading name

https://bz.apache.org/bugzilla/show_bug.cgi?id=59930


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/0c4f5b1b
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/0c4f5b1b
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/0c4f5b1b

Branch: refs/heads/master
Commit: 0c4f5b1b629f96ffda3d4aca672e10c40b55bf0b
Parents: a62d5f9
Author: Stefan Bodewig <[email protected]>
Authored: Sun Aug 7 11:16:32 2016 +0200
Committer: Stefan Bodewig <[email protected]>
Committed: Sun Aug 7 11:19:01 2016 +0200

----------------------------------------------------------------------
 WHATSNEW                                        |  3 +++
 manual/Tasks/get.html                           |  5 ++++-
 src/main/org/apache/tools/ant/taskdefs/Get.java | 13 +++++++++++--
 3 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/0c4f5b1b/WHATSNEW
----------------------------------------------------------------------
diff --git a/WHATSNEW b/WHATSNEW
index 50128b8..cc199c2 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -49,6 +49,9 @@ Fixed bugs:
    of the expected format.
    Bugzilla Report 59909
 
+ * Clarified the documentation of <get>'s retries attribute.
+   Bugzilla Report 59930
+
 Other changes:
 --------------
 

http://git-wip-us.apache.org/repos/asf/ant/blob/0c4f5b1b/manual/Tasks/get.html
----------------------------------------------------------------------
diff --git a/manual/Tasks/get.html b/manual/Tasks/get.html
index 04bc0e4..a2c9b7e 100644
--- a/manual/Tasks/get.html
+++ b/manual/Tasks/get.html
@@ -107,7 +107,10 @@ plain text' authentication is used. This is only secure 
over an HTTPS link.
   </tr>  
   <tr>
     <td valign="top">retries</td>
-    <td valign="top">the per download number of retries on error<br/>
+    <td valign="top">The number of attempts to make for opening the URI.<br/>
+      The name of the attribute is misleading as a value of 1 means
+      "don't retry on error" and a value of 0 meant don't even try to
+      reach the URI at all.<br/>
       <em>since Ant 1.8.0</em></td>
     <td align="center" valign="top">No; default "3"</td>
   </tr>

http://git-wip-us.apache.org/repos/asf/ant/blob/0c4f5b1b/src/main/org/apache/tools/ant/taskdefs/Get.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/Get.java 
b/src/main/org/apache/tools/ant/taskdefs/Get.java
index 6c53790..83f3b6b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Get.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Get.java
@@ -413,13 +413,22 @@ public class Get extends Task {
     }
 
     /**
-     * The number of retries to attempt upon error, defaults to 3.
+     * The number of attempts to make for opening the URI, defaults to 3.
      *
-     * @param r retry count
+     * <p>The name of the method is misleading as a value of 1 means
+     * "don't retry on error" and a value of 0 meant don't even try to
+     * reach the URI at all.</p>
+     *
+     * @param r number of attempts to make
      *
      * @since Ant 1.8.0
      */
     public void setRetries(final int r) {
+        if (r <= 0) {
+            log("Setting retries to " + r
+                + " will make the task not even try to reach the URI at all",
+                Project.MSG_WARN);
+        }
         this.numberRetries = r;
     }
 

Reply via email to