Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

Commit 5d16917

Browse files
committed
Use try-with-resources. Better local var name.
1 parent 858031d commit 5d16917

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,12 +1601,12 @@ private String[] toFirstRecordValues(final String expected, final CSVFormat form
16011601
return CSVParser.parse(expected, format).getRecords().get(0).values();
16021602
}
16031603

1604-
private void tryFormat(final List<String> l, final Character quote, final Character escape, final String expected) throws IOException {
1604+
private void tryFormat(final List<String> list, final Character quote, final Character escape, final String expected) throws IOException {
16051605
final CSVFormat format = CSVFormat.DEFAULT.withQuote(quote).withEscape(escape).withRecordSeparator(null);
16061606
final Appendable out = new StringBuilder();
1607-
final CSVPrinter printer = new CSVPrinter(out, format);
1608-
printer.printRecord(l);
1609-
printer.close();
1607+
try (final CSVPrinter printer = new CSVPrinter(out, format)) {
1608+
printer.printRecord(list);
1609+
}
16101610
assertEquals(expected, out.toString());
16111611
}
16121612
}

0 commit comments

Comments
 (0)