From bd76a2fb376a13bd35178be285afcc54aa457832 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 26 Aug 2008 04:30:39 +0000 Subject: [PATCH] Don't use a thousands separator at all for minutes. PR 44659. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@688958 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 6 ++++++ src/main/org/apache/tools/ant/util/DateUtils.java | 2 +- .../junit/org/apache/tools/ant/util/DateUtilsTest.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 071c82cce..ff986267b 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -85,6 +85,12 @@ Changes that could break older environments: may not have started at all. Bugzilla Report 45227. + * If the number of minutes a build takes is bigger then 1000 Ant will + no longer print a thousands separator in the "elapsed time" + message. It used to be the thousands separator of the current + locale. + Bugzilla Report 44659. + Fixed bugs: ----------- diff --git a/src/main/org/apache/tools/ant/util/DateUtils.java b/src/main/org/apache/tools/ant/util/DateUtils.java index 30fd884cc..c9216d262 100644 --- a/src/main/org/apache/tools/ant/util/DateUtils.java +++ b/src/main/org/apache/tools/ant/util/DateUtils.java @@ -73,7 +73,7 @@ public final class DateUtils { private static final double[] LIMITS = {0, 1, 2}; - private static final String[] MINUTES_PART = {"", "1 minute ", "{0,number} minutes "}; + private static final String[] MINUTES_PART = {"", "1 minute ", "{0,number,###############} minutes "}; private static final String[] SECONDS_PART = {"0 seconds", "1 second", "{1,number} seconds"}; diff --git a/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java b/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java index 0cec840c7..b69f6f091 100644 --- a/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java +++ b/src/tests/junit/org/apache/tools/ant/util/DateUtilsTest.java @@ -43,7 +43,7 @@ public class DateUtilsTest extends TestCase { } // https://issues.apache.org/bugzilla/show_bug.cgi?id=44659 - public void XtestLongElapsedTime(){ + public void testLongElapsedTime(){ assertEquals("2926 minutes 13 seconds", DateUtils.formatElapsedTime(1000 * 175573)); }