You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Diane Holt <ho...@yahoo.com> on 2000/09/21 02:01:59 UTC

[PATCH] DefaultLogger.java

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/