camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Keller (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-7578) camel-bindy - pattern attribute should not be ignored if locale is not set
Date Fri, 04 Jul 2014 13:10:34 GMT

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

Peter Keller updated CAMEL-7578:
--------------------------------

    Description: 
This code doesn't pad field {{mandant}} with "0" if locale is not set: 
{code}
@CsvRecord(separator = ",")
public class Unity {
    @DataField(pos = 1, pattern = "000")
    public float mandant;
{code}

Route:
{code}
final BindyCsvDataFormat bindy = new BindyCsvDataFormat(Unity.class);
from("direct:start")
    .marshal(bindy)
    .log("${body}");
{code}

Testing with:
{code}
final Unity unity = new Unity();
unity.mandant = 50f;
final ProducerTemplate template = context.createProducerTemplate();
{code}

This prints:
{quote}
50.0
{quote}

Only when setting the locale, {{pattern}} is not ignored:
{code}
bindy.setLocale(Locale.US.getISO3Country());
{code}

This prints:
{quote}
050
{quote}


  was:
This code doesn't pad field mandant with "0" if locale is not set: 
{code}
@CsvRecord(separator = ",")
public class Unity {
    @DataField(pos = 1, pattern = "000")
    public float mandant;
{code}

Route:
{code}
final BindyCsvDataFormat bindy = new BindyCsvDataFormat(Unity.class);
from("direct:start")
    .marshal(bindy)
    .log("${body}");
{code}

Testing with:
{code}
final Unity unity = new Unity();
unity.mandant = 50f;
final ProducerTemplate template = context.createProducerTemplate();
{code}

This prints:
{quote}
50.0
{quote}

Only when setting the locale, {{pattern}} is not ignored:
{code}
bindy.setLocale(Locale.US.getISO3Country());
{code}

This prints:
{quote}
050
{quote}



> camel-bindy - pattern attribute should not be ignored if locale is not set
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-7578
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7578
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-bindy
>    Affects Versions: 2.13.1
>            Reporter: Peter Keller
>
> This code doesn't pad field {{mandant}} with "0" if locale is not set: 
> {code}
> @CsvRecord(separator = ",")
> public class Unity {
>     @DataField(pos = 1, pattern = "000")
>     public float mandant;
> {code}
> Route:
> {code}
> final BindyCsvDataFormat bindy = new BindyCsvDataFormat(Unity.class);
> from("direct:start")
>     .marshal(bindy)
>     .log("${body}");
> {code}
> Testing with:
> {code}
> final Unity unity = new Unity();
> unity.mandant = 50f;
> final ProducerTemplate template = context.createProducerTemplate();
> {code}
> This prints:
> {quote}
> 50.0
> {quote}
> Only when setting the locale, {{pattern}} is not ignored:
> {code}
> bindy.setLocale(Locale.US.getISO3Country());
> {code}
> This prints:
> {quote}
> 050
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message