svn commit: r1200231 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java

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

svn commit: r1200231 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java

sascharodekamp
Author: sascharodekamp
Date: Thu Nov 10 09:15:01 2011
New Revision: 1200231

URL: http://svn.apache.org/viewvc?rev=1200231&view=rev
Log:
IMPROVEMENT: Replace String == null with UtilValidate.isEmpty() (https://issues.apache.org/jira/browse/OFBIZ-4546). A patch from Dimitri Unruh: In UtilDateTime are some String == null comparisons. I replaces them with UtilValidate.isEmpty()

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

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java?rev=1200231&r1=1200230&r2=1200231&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java Thu Nov 10 09:15:01 2011
@@ -969,7 +969,7 @@ public class UtilDateTime {
      */
     public static DateFormat toDateFormat(String dateFormat, TimeZone tz, Locale locale) {
         DateFormat df = null;
-        if (dateFormat == null) {
+        if (UtilValidate.isEmpty(dateFormat)) {
             df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
         } else {
             df = new SimpleDateFormat(dateFormat);
@@ -987,7 +987,7 @@ public class UtilDateTime {
      */
     public static DateFormat toDateTimeFormat(String dateTimeFormat, TimeZone tz, Locale locale) {
         DateFormat df = null;
-        if (dateTimeFormat == null) {
+        if (UtilValidate.isEmpty(dateTimeFormat)) {
             df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, locale);
         } else {
             df = new SimpleDateFormat(dateTimeFormat);
@@ -1005,7 +1005,7 @@ public class UtilDateTime {
      */
     public static DateFormat toTimeFormat(String timeFormat, TimeZone tz, Locale locale) {
         DateFormat df = null;
-        if (timeFormat == null) {
+        if (UtilValidate.isEmpty(timeFormat)) {
             df = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale);
         } else {
             df = new SimpleDateFormat(timeFormat);