Clemens Blamauer created CAMEL-12394:
----------------------------------------

             Summary: Camel Bindy: marshal doesn't quote headers
                 Key: CAMEL-12394
                 URL: https://issues.apache.org/jira/browse/CAMEL-12394
             Project: Camel
          Issue Type: Bug
          Components: camel-bindy
    Affects Versions: 2.20.2
         Environment: Windows 7
            Reporter: Clemens Blamauer
         Attachments: BindyCsvFactory.patch, WickedCsv.java, WickedCsvTest.java

Dear all,

When marshaling, Bindy doesn't quote headers in CSV files. This is problematic 
in the case where headers contain the separator character. When unmarshaling 
this is no issue, as `skipFirstLine=true`.

Unfortunately, changing the header is not an option in my case.

Please find attached:
 * A sample CsvRecord-annotated bean `WickedCsv.java`, and
 * a JUnit test `WickedCsvTest.java`
which allow to reproduce the issue.

The assertion error occurs in the last line of the `test()` method:  
`assertEquals(csv.trim(), result.trim())`

I have attached a patch for BindyCsvFactory (`BindyCsvFactory.patch`), which 
fixes the issue. I copied and adjusted the lines according to the quote 
handling in `org.apache.camel.dataformat.bindy.BindyCsvFactory#bind`.

Would you please check?

Thank you.

Kind regards,
Clemens




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to