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");