cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r661413 - in /cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common: DataTypeAdapter.java Messages.properties
Date Thu, 29 May 2008 17:30:29 GMT
Author: dkulp
Date: Thu May 29 10:30:29 2008
New Revision: 661413

URL: http://svn.apache.org/viewvc?rev=661413&view=rev
Log:
[CXF-1602] Revert last commit as null is actually valid if the date is a optional attribute.
 Just return null.

Modified:
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/DataTypeAdapter.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Messages.properties

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/DataTypeAdapter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/DataTypeAdapter.java?rev=661413&r1=661412&r2=661413&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/DataTypeAdapter.java
(original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/DataTypeAdapter.java
Thu May 29 10:30:29 2008
@@ -20,26 +20,23 @@
 
 import java.util.Calendar;
 import java.util.Date;
-import java.util.logging.Logger;
 
 import javax.xml.bind.DatatypeConverter;
 
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.interceptor.Fault;
-
 public final class DataTypeAdapter {
-    private static final Logger LOG = LogUtils.getL7dLogger(DataTypeAdapter.class);
 
     private DataTypeAdapter() {
     }
 
     public static Date parseDate(String s) {
+        if (s == null) {
+            return null;
+        }
         return DatatypeConverter.parseDate(s).getTime();
     }
     public static String printDate(Date dt) {
         if (dt == null) {
-            throw new Fault(new Message("NULL_PASSED_FOR_DATE", LOG));
+            return null;
         }
         Calendar c = Calendar.getInstance();
         c.setTime(dt);
@@ -47,11 +44,14 @@
     }
 
     public static Date parseTime(String s) {
+        if (s == null) {
+            return null;
+        }
         return DatatypeConverter.parseTime(s).getTime();
     }
     public static String printTime(Date dt) {
         if (dt == null) {
-            throw new Fault(new Message("NULL_PASSED_FOR_DATE", LOG));
+            return null;
         }
         Calendar c = Calendar.getInstance();
         c.setTime(dt);
@@ -59,11 +59,14 @@
     }
 
     public static Date parseDateTime(String s) {
+        if (s == null) {
+            return null;
+        }
         return DatatypeConverter.parseDateTime(s).getTime();
     }
     public static String printDateTime(Date dt) {
         if (dt == null) {
-            throw new Fault(new Message("NULL_PASSED_FOR_DATE", LOG));
+            return null;
         }
         Calendar c = Calendar.getInstance();
         c.setTime(dt);

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Messages.properties?rev=661413&r1=661412&r2=661413&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Messages.properties (original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/Messages.properties Thu
May 29 10:30:29 2008
@@ -31,4 +31,3 @@
 FAIL_TO_WRITE_FILE = Failed to write file: {0}
 FAIL_TO_COMPILE_GENERATE_CODES = Failed to compile generated code
 
-NULL_PASSED_FOR_DATE = Null Date passed to DataTypeAdapter
\ No newline at end of file



Mime
View raw message