[ 
https://issues.apache.org/jira/browse/BETWIXT-58?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin van den Bemt resolved BETWIXT-58.
----------------------------------------

    Resolution: Fixed

Author: mvdb
Date: Sat Jun 30 02:26:22 2007
New Revision: 552123

URL: http://svn.apache.org/viewvc?view=rev&rev=552123
Log:
Fix BETWIXT-58. Thanx to Kevin Waugh for spotting this.

Modified:
    
jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.java
    
jakarta/commons/proper/betwixt/trunk/src/test/org/apache/commons/betwixt/strategy/TestObjectStringConverters.java

> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to