commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Waugh (JIRA)" <j...@apache.org>
Subject [jira] Created: (BETWIXT-58) Empty string bug
Date Wed, 02 May 2007 20:11:15 GMT
Empty string bug
----------------

                 Key: BETWIXT-58
                 URL: https://issues.apache.org/jira/browse/BETWIXT-58
             Project: Commons Betwixt
          Issue Type: Bug
    Affects Versions: Nightly Builds
         Environment: N/A
            Reporter: Kevin Waugh
            Priority: Minor
             Fix For: Nightly Builds


If you create a bean with a string property and set the string to be the empty string then
write the bean to xml using Betwixt upon reading the bean the string property will be set
to null.

The stringToObject method in ConvertUtilsObjectStringConverter does not obey it's javadoc
description.  The following patch still violates the description, but fixes the bug stated.

Index: src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java
===================================================================
--- src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java (revision
534335)
+++ src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java (working
copy)
@@ -61,7 +61,7 @@
     public Object stringToObject(String value, Class type, String flavour, Context context)
{
         if (value == null || "".equals(value))
         {
-            return null;
+            return value;
         }

         return ConvertUtils.convert( value, type );


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message