You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2014/12/28 02:00:40 UTC

svn commit: r1648140 - /ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilDateTime.java

Author: adrianc
Date: Sun Dec 28 01:00:39 2014
New Revision: 1648140

URL: http://svn.apache.org/r1648140
Log:
Merged revision(s) 1648139 from ofbiz/trunk:
Fixed a NPE I introduced in rev 1647606. Reported by Pierre Smits on dev mailing list.


Modified:
    ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilDateTime.java

Modified: ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilDateTime.java?rev=1648140&r1=1648139&r2=1648140&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilDateTime.java (original)
+++ ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilDateTime.java Sun Dec 28 01:00:39 2014
@@ -972,7 +972,7 @@ public class UtilDateTime {
         if (UtilValidate.isEmpty(dateFormat)) {
             df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
         } else {
-            df = new SimpleDateFormat(dateFormat, locale);
+            df = new SimpleDateFormat(dateFormat, locale == null ? Locale.getDefault() : locale);
         }
         df.setTimeZone(tz);
         return df;
@@ -990,7 +990,7 @@ public class UtilDateTime {
         if (UtilValidate.isEmpty(dateTimeFormat)) {
             df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, locale);
         } else {
-            df = new SimpleDateFormat(dateTimeFormat, locale);
+            df = new SimpleDateFormat(dateTimeFormat, locale == null ? Locale.getDefault() : locale);
         }
         df.setTimeZone(tz);
         return df;
@@ -1008,7 +1008,7 @@ public class UtilDateTime {
         if (UtilValidate.isEmpty(timeFormat)) {
             df = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale);
         } else {
-            df = new SimpleDateFormat(timeFormat, locale);
+            df = new SimpleDateFormat(timeFormat, locale == null ? Locale.getDefault() : locale);
         }
         df.setTimeZone(tz);
         return df;