svn commit: r934289 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r934289 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java

adrianc
Author: adrianc
Date: Thu Apr 15 05:10:59 2010
New Revision: 934289

URL: http://svn.apache.org/viewvc?rev=934289&view=rev
Log:
Fixed a TimeDuration speed issue that was revealed by Coburtura.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java?rev=934289&r1=934288&r2=934289&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/TimeDuration.java Thu Apr 15 05:10:59 2010
@@ -92,7 +92,7 @@ public class TimeDuration implements Ser
         }
 
         // compute elapsed years
-        long yearMillis = 86400000 * calStart.getMinimum(Calendar.DAY_OF_YEAR);
+        long yearMillis = 86400000 * calStart.getLeastMaximum(Calendar.DAY_OF_YEAR);
         float units = deltaMillis / yearMillis;
         this.years = factor * advanceCalendar(calStart, calEnd, (int) units, Calendar.YEAR);
         deltaMillis = computeDeltaMillis(calStart.getTimeInMillis(), targetMillis);