ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject [PATCH] DefaultLogger.java
Date Thu, 21 Sep 2000 00:01:59 GMT
When the number of minutes or seconds for the build time is one, the
output should be singular not plural. (Not a big deal, I know, but it's
bugging me... :)

As before, novice java programmer (phrase used very loosely) alert, so if
I've done it the long/wrong way, feel free to fix it. Patch-file is
attached; here's the simple diff:
190a191,195
>      String min = "minute" ;
>      String mins = "minutes" ;
>      String sec = "second" ;
>      String secs = "seconds" ;
>
194c199,202
<      return Long.toString(minutes) + " minutes " + Long.toString(second
s%60) + " seconds";
---
>      return Long.toString(minutes) + " " +
>        (minutes == 1 ? min : mins) + " " +
>        Long.toString(seconds%60) + " " +
>        (seconds%60 == 1 ? sec : secs) ;
197c205
<      return Long.toString(seconds) + " seconds";
---
>      return Long.toString(seconds) + " " + (seconds == 1 ? sec :secs) ;

BTW: I tested it using a target that <exec>'s a shell-script that just
sleeps, adjusting the amount to produce the different combinations of
seconds and minutes-and-seconds. (Even the smallest of changes deserve
their moment of QA :)

Thanks,
Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
Mime
View raw message