mirror of
https://github.com/apache/commons-csv.git
synced 2025-02-09 03:25:24 +00:00
Use try-with-resources. Better local var name.
This commit is contained in:
parent
858031d1a3
commit
5d16917835
@ -1601,12 +1601,12 @@ public class CSVPrinterTest {
|
||||
return CSVParser.parse(expected, format).getRecords().get(0).values();
|
||||
}
|
||||
|
||||
private void tryFormat(final List<String> l, final Character quote, final Character escape, final String expected) throws IOException {
|
||||
private void tryFormat(final List<String> list, final Character quote, final Character escape, final String expected) throws IOException {
|
||||
final CSVFormat format = CSVFormat.DEFAULT.withQuote(quote).withEscape(escape).withRecordSeparator(null);
|
||||
final Appendable out = new StringBuilder();
|
||||
final CSVPrinter printer = new CSVPrinter(out, format);
|
||||
printer.printRecord(l);
|
||||
printer.close();
|
||||
try (final CSVPrinter printer = new CSVPrinter(out, format)) {
|
||||
printer.printRecord(list);
|
||||
}
|
||||
assertEquals(expected, out.toString());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user