Author: adrianc
Date: Thu Apr 15 05:10:59 2010
New Revision: 934289
URL:
http://svn.apache.org/viewvc?rev=934289&view=revLog:
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);