On Tue, Nov 27, 2012 at 9:00 AM, lb <lburgazz...@gmail.com> wrote:
>
> In org.apache.camel.dataformat.bindy.FormatFactory for non "BigNumbers" the
> Format object is chosen as follow:
>
> if (clazz == float.class || clazz == Float.class) {
>     return pattern != null ? new FloatPatternFormat(pattern,
> getLocale(locale)) : new FloatFormat();
> }
>
> I've noticed that the DataFiled annotation define the pattern field with ""
> (empty String) as default value, thus the FormatFactory will always return
> the *PatternFormat and never the simple *Format.
>
> Is there a reason for such behavior?
>

I would assume even an "" pattern would cause the FloatPatternFormat
to fail. So the code is "correct" although it seems broken.
What may be better is to use ObjectHelper.isEmpty(pattern) which
checks for null/empty strings.

Feel free to open a JIRA and submit a patch.
We love contributions
http://camel.apache.org/contributing.html

>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-bindy-Handle-implied-decimal-field-tp5723003p5723280.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to