[CSV-130] CSVFormat#withHeader doesn't work well with #printComment, add withHeaderComments(String...). Adjust test for style.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1623985 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2014-09-10 12:49:53 +00:00
parent a4f737108b
commit e650b9d699
1 changed files with 2 additions and 2 deletions

View File

@ -517,9 +517,9 @@ public class CSVPrinterTest {
csvPrinter.close();
}
private CSVPrinter printWithHeaderComments(final StringWriter sw, Date now, CSVFormat format)
private CSVPrinter printWithHeaderComments(final StringWriter sw, Date now, CSVFormat baseFormat)
throws IOException {
format = format.withCommentMarker('#').withHeader("Col1", "Col2");
CSVFormat format = baseFormat.withCommentMarker('#').withHeader("Col1", "Col2");
format = format.withHeaderComments("Generated by Apache Commons CSV 1.1", now);
final CSVPrinter csvPrinter = format.print(sw);
csvPrinter.printRecord("A", "B");