[ 
https://issues.apache.org/jira/browse/BEANUTILS-286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12550758
 ] 

Niall Pemberton commented on BEANUTILS-286:
-------------------------------------------

Firstly no code is broken since CalendarConverter didn't exist in the last 
BeanUtils 1.7.0 release[1]. Even for the converters that did exist (e.g. 
IntegerConverter) the 1.7.0 version had no other public methods other than 
convert(Class, Object)  - all these facilities to set patterns etc are new 
features introduced in BeanUtils 1.8.0[2].

As to the rationale - this makes the standard configured converters "thread 
safe" since it prevents them being modified once they are registered. The aim 
being to help people avoid "shooting themselves in the foot". Having said that 
nothing prevents you from configuring the CalendarConverter yourself and 
registering it in the following way:

    CalendarConverter calConverter = new CalendarConverter();
    calConverter.setPattern("yyyy.MM.dd G 'at' HH:mm:ss z"); 
    ConvertUtils.register(calConverter, Calendar.class);

Although if you do - I would recommend you wrap it in the ConverterFacade - to 
ensure thread safety :)

[1] http://commons.apache.org/beanutils/commons-beanutils-1.7.0/docs/api/
[2] http://commons.apache.org/beanutils/v1.8.0-BETA/apidocs/index.html

> New Facade converter implementation - hide non-Converter public APIs
> --------------------------------------------------------------------
>
>                 Key: BEANUTILS-286
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-286
>             Project: Commons BeanUtils
>          Issue Type: New Feature
>          Components: ConvertUtils & Converters
>    Affects Versions: 1.7.0
>            Reporter: Niall Pemberton
>            Assignee: Niall Pemberton
>            Priority: Minor
>             Fix For: 1.8.0
>
>
> Provide a "facade" Converter implementation that delegates to a specified 
> Converter, but hides any public API other than that defined in the Converter 
> interface.

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

Reply via email to