commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <j...@apache.org>
Subject [jira] Updated: (BEANUTILS-10) [beanutils] StringLocaleConverter uses same pattern for numbers and dates
Date Thu, 12 Jul 2007 06:19:04 GMT

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

Niall Pemberton updated BEANUTILS-10:
-------------------------------------

        Fix Version/s:     (was: 1.8.0)
                       LATER THAN 1.8.0
    Affects Version/s: 1.7.0

> [beanutils] StringLocaleConverter uses same pattern for numbers and dates
> -------------------------------------------------------------------------
>
>                 Key: BEANUTILS-10
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-10
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Locale BeanUtils / Converters
>    Affects Versions: 1.7.0
>         Environment: Operating System: All
> Platform: All
>            Reporter: Brian Rodgers
>             Fix For: LATER THAN 1.8.0
>
>         Attachments: mixed-bean-test.zip
>
>
> StringLocaleConverter doesn't appear to allow for the fact that you need 
> separate patterns when converting a date field than you do when converting a 
> number field.  Hence, when copying values from a typed bean to a String bean 
> (such as when copying data into an ActionForm), if the typed bean has both 
> numbers and dates, one or the other will be corrupted.
> To reproduce:
> 1. Create a bean that contains a java.util.Date field and a number (any 
> numeric object or primative) field.  
> 2. Create another bean with matching String fields.
> 3. Populate data into the typed bean from step 1.
> 4. Register a StringLocaleConverter using a date pattern.  
> 5. User LocalBeanUtils.copyProperties to copy from the typed bean (step 1) to 
> the String bean (step 2).
> 6. Print the fields in the String bean.  The date field will be properly 
> converted, but the number field will be formatted (to the extent that it can 
> be) using the date pattern.
> Of course, it also works the other way -- specify a number pattern and the 
> date field will be corrupted.

-- 
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