From e650b9d6995e99a7b6520e3096c1f84d9244e4ac Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Wed, 10 Sep 2014 12:49:53 +0000 Subject: [PATCH] [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 --- src/test/java/org/apache/commons/csv/CSVPrinterTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java index f4665f64..a96e3439 100644 --- a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java +++ b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java @@ -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");