[
https://issues.apache.org/jira/browse/CSV-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997045#comment-14997045
]
Emmanuel Bourg commented on CSV-161:
------------------------------------
Hi Kristof, {{CSVFormat}} is immutable, if you don't use or assign the return
value of the {{withXXX()}} methods it has no effect.
For this reason your second test:
{code:java}
public void declarationOneLineForEach() {
CSVFormat csvFormat = CSVFormat.newFormat(',');
csvFormat.withQuote('\'');
csvFormat.withQuoteMode(QuoteMode.ALL);
assertEquals("'x',' y ','z'", csvFormat.format(strings));
}
{code}
is actually equivalent to:
{code:java}
public void declarationOneLineForEach() {
CSVFormat csvFormat = CSVFormat.newFormat(',');
assertEquals("'x',' y ','z'", csvFormat.format(strings));
}
{code}
I guess this explains the behavior you observed.
> Quotes are ignored depending on declaration order
> -------------------------------------------------
>
> Key: CSV-161
> URL: https://issues.apache.org/jira/browse/CSV-161
> Project: Commons CSV
> Issue Type: Bug
> Affects Versions: 1.2
> Environment: JDK 1.8
> Reporter: Kristof Meixner
> Attachments: VariousLibraryTests.java
>
>
> The quoting mode depends on the order of format declaration.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)