ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5901] New: - error of formatting time in DefaultLogger
Date Thu, 17 Jan 2002 14:36:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5901>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5901

error of formatting time in DefaultLogger

           Summary: error of formatting time in DefaultLogger
           Product: Ant
           Version: 1.3
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: ruchet@besancon.sema.slb.com


If number of seconds % 60 is 0, you write "0 seconds" (with s)
Correction of formatTime method:
protected static String formatTime(long millis) {
        long seconds = millis / 1000;
        long minutes = seconds / 60;


        if (minutes > 0) {
            return Long.toString(minutes) + " minute"
                + (minutes == 1 ? " " : "s ")
                + Long.toString(seconds%60) + " second"
                //+ (seconds%60 == 1 ? "" : "s");
                + (seconds%60 > 1 ? "" : "s");
        }
        else {
            return Long.toString(seconds) + " second"
                //+ (seconds%60 == 1 ? "" : "s");
                //the "%60" is unnecessary because in else
                // 0 <= seconds < 60
                + (seconds > 1 ? "" : "s");
        }

    }


Note that another definition of formatTime must be fixed in:
org.apache.tools.ant.taskdefs.optional.ide.VAJAntToolGUI.java

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message