Author: sback
Date: 2007-07-03 21:57:27 +0000 (Tue, 03 Jul 2007)
New Revision: 13906

Modified:
   trunk/freenet/src/freenet/support/TimeUtil.java
Log:
Bugfix: now it works correctly when formatTime() is called with term argument 0 
or 1

Modified: trunk/freenet/src/freenet/support/TimeUtil.java
===================================================================
--- trunk/freenet/src/freenet/support/TimeUtil.java     2007-07-03 21:38:24 UTC 
(rev 13905)
+++ trunk/freenet/src/freenet/support/TimeUtil.java     2007-07-03 21:57:27 UTC 
(rev 13906)
@@ -48,6 +48,9 @@
         if( !withSecondFractions && l < 1000 ) {
             return "";
         }
+        if(termCount >= maxTerms) {
+            return sb.toString();
+        }
         //
         int weeks = (int)(l / ((long)7*24*60*60*1000));
         if (weeks > 0) {
@@ -55,6 +58,9 @@
             termCount++;
             l = l - ((long)weeks * ((long)7*24*60*60*1000));
         }
+        if(termCount >= maxTerms) {
+            return sb.toString();
+        }
         //
         int days = (int)(l / ((long)24*60*60*1000));
         if (days > 0) {


Reply via email to