Skip to content

Commit e650b9d

Browse files
committed
[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
1 parent a4f7371 commit e650b9d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/java/org/apache/commons/csv/CSVPrinterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,9 @@ public void testHeaderCommentTdf() throws IOException {
517517
csvPrinter.close();
518518
}
519519

520-
private CSVPrinter printWithHeaderComments(final StringWriter sw, Date now, CSVFormat format)
520+
private CSVPrinter printWithHeaderComments(final StringWriter sw, Date now, CSVFormat baseFormat)
521521
throws IOException {
522-
format = format.withCommentMarker('#').withHeader("Col1", "Col2");
522+
CSVFormat format = baseFormat.withCommentMarker('#').withHeader("Col1", "Col2");
523523
format = format.withHeaderComments("Generated by Apache Commons CSV 1.1", now);
524524
final CSVPrinter csvPrinter = format.print(sw);
525525
csvPrinter.printRecord("A", "B");

0 commit comments

Comments
 (0)