getDayEnd will have a null pointer exception when the offset is not provided. This can cause very strange behaviour in the system when people forget to enter a value in terms. When not provided zero is assumed now

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1205710 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hans Bakker
2011-11-24 02:54:14 +00:00
parent a63a1e8c26
commit d4fa24f6a6
@@ -823,6 +823,9 @@ public class UtilDateTime {
}
public static Timestamp getDayEnd(Timestamp stamp, Long daysLater, TimeZone timeZone, Locale locale) {
if (daysLater == null) {
daysLater = Long.valueOf(0);
}
Calendar tempCal = toCalendar(stamp, timeZone, locale);
tempCal.set(tempCal.get(Calendar.YEAR), tempCal.get(Calendar.MONTH), tempCal.get(Calendar.DAY_OF_MONTH), 23, 59, 59);
tempCal.add(Calendar.DAY_OF_MONTH, daysLater.intValue());