Author: jochen
Date: Tue Jan 30 13:19:25 2007
New Revision: 501567

URL: http://svn.apache.org/viewvc?view=rev&rev=501567
Log:
The DateParser is now treating an empty string as null.
Submitted-by: Carsten Wolters, [EMAIL PROTECTED]
PR: XMLRPC-133

Modified:
    
webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/common/src/main/java/org/apache/xmlrpc/parser/DateParser.java
    webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/pom.xml
    webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/changes/changes.xml

Modified: 
webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/common/src/main/java/org/apache/xmlrpc/parser/DateParser.java
URL: 
http://svn.apache.org/viewvc/webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/common/src/main/java/org/apache/xmlrpc/parser/DateParser.java?view=diff&rev=501567&r1=501566&r2=501567
==============================================================================
--- 
webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/common/src/main/java/org/apache/xmlrpc/parser/DateParser.java
 (original)
+++ 
webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/common/src/main/java/org/apache/xmlrpc/parser/DateParser.java
 Tue Jan 30 13:19:25 2007
@@ -1,44 +1,48 @@
-/*
- * Copyright 1999,2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.xmlrpc.parser;
-
-import java.text.Format;
-import java.text.ParseException;
-
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-
-/** Parser for integer values.
- */
-public class DateParser extends AtomicParser {
-       private final Format f;
-
-    /** Creates a new instance with the given format.
-     */
-    public DateParser(Format pFormat) {
-        f = pFormat;
-    }
-
-    protected void setResult(String pResult) throws SAXException {
-               try {
-                       super.setResult(f.parseObject(pResult.trim()));
-               } catch (ParseException e) {
-                       throw new SAXParseException("Failed to parse integer 
value: " + pResult,
-                                                                               
getDocumentLocator());
-               }
-       }
-}
+/*
+ * Copyright 1999,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.xmlrpc.parser;
+
+import java.text.Format;
+import java.text.ParseException;
+
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+
+/** Parser for integer values.
+ */
+public class DateParser extends AtomicParser {
+       private final Format f;
+
+    /** Creates a new instance with the given format.
+     */
+    public DateParser(Format pFormat) {
+        f = pFormat;
+    }
+
+    protected void setResult(String pResult) throws SAXException {
+        final String s = pResult.trim();
+        if (s.length() == 0) {
+            return;
+        }
+               try {
+                       super.setResult(f.parseObject(s));
+               } catch (ParseException e) {
+                       throw new SAXParseException("Failed to parse integer 
value: " + pResult,
+                                                                               
getDocumentLocator());
+               }
+       }
+}

Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/pom.xml
URL: 
http://svn.apache.org/viewvc/webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/pom.xml?view=diff&rev=501567&r1=501566&r2=501567
==============================================================================
--- webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/pom.xml (original)
+++ webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/pom.xml Tue Jan 30 13:19:25 
2007
@@ -174,6 +174,10 @@
             <email>[EMAIL PROTECTED]</email>
         </contributor>
         <contributor>
+            <name>Carsten Wolters</name>
+            <email>[EMAIL PROTECTED]</email>
+        </contributor>
+        <contributor>
             <name>Ken Weiner</name>
             <email>[EMAIL PROTECTED]</email>
         </contributor>

Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/changes/changes.xml?view=diff&rev=501567&r1=501566&r2=501567
==============================================================================
--- webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/changes/changes.xml 
(original)
+++ webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/changes/changes.xml Tue 
Jan 30 13:19:25 2007
@@ -45,6 +45,10 @@
           due-to="Juho Yli-Krekola" due-to-email="[EMAIL PROTECTED]">
         The configuration of the reply timeout in the commons transport was 
wrong.
       </action>
+      <action dev="jochen" type="fix" issue="XMLRPC-133"
+          due-to="Carsten Wolters" due-to-email="[EMAIL PROTECTED]">
+        The DateParser is now treating an empty string as null.
+      </action>
     </release>
     <release version="3.0" date="30-Aug-2006">
       <action dev="jochen" type="fix" due-to="Matt Preston"


Reply via email to