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

=====
([EMAIL PROTECTED])



__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
*** 
D:/dianeh/work/ant/latest/src/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/../DefaultLogger.java
 Fri Sep 15 22:03:22 2000
--- DefaultLogger.java Wed Sep 20 13:04:32 2000
***************
*** 188,200 ****
      private static String formatTime(long millis) {
          long seconds = millis / 1000;
          long minutes = seconds / 60;
  
  
          if (minutes > 0) {
!             return Long.toString(minutes) + " minutes " + 
Long.toString(seconds%60) + " seconds";
          }
          else {
!             return Long.toString(seconds) + " seconds";
          }
  
      }
--- 188,208 ----
      private static String formatTime(long millis) {
          long seconds = millis / 1000;
          long minutes = seconds / 60;
+         String min = "minute" ;
+         String mins = "minutes" ;
+         String sec = "second" ;
+         String secs = "seconds" ;
+  
  
  
          if (minutes > 0) {
!             return Long.toString(minutes) + " " +
!               (minutes == 1 ? min : mins) + " " +
!               Long.toString(seconds%60) + " " +
!               (seconds%60 == 1 ? sec : secs) ;
          }
          else {
!             return Long.toString(seconds) + " " + (seconds == 1 ? sec : secs) 
;
          }
  
      }

Reply via email to