diff --git a/WHATSNEW b/WHATSNEW index 50128b852..cc199c207 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -49,6 +49,9 @@ Fixed bugs: of the expected format. Bugzilla Report 59909 + * Clarified the documentation of 's retries attribute. + Bugzilla Report 59930 + Other changes: -------------- diff --git a/manual/Tasks/get.html b/manual/Tasks/get.html index 04bc0e4d5..a2c9b7e59 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. retries - the per download number of retries on error
+ The number of attempts to make for opening the URI.
+ 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.
since Ant 1.8.0 No; default "3" diff --git a/src/main/org/apache/tools/ant/taskdefs/Get.java b/src/main/org/apache/tools/ant/taskdefs/Get.java index 6c5379079..83f3b6bf0 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 + *

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.

+ * + * @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; }