commons-dev mailing list archives

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

                 Key: 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/
--- src/java/org/apache/commons/betwixt/strategy/ (revision
+++ src/java/org/apache/commons/betwixt/strategy/ (working
@@ -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:
For additional commands, e-mail:

View raw message