Skip to content
Permalink
Browse files
Use try-with-resources. Better local var name.
  • Loading branch information
garydgregory committed Jul 3, 2021
1 parent 858031d commit 5d16917835d11da3b07d68b6658447988f76200d
Showing 1 changed file with 4 additions and 4 deletions.
@@ -1601,12 +1601,12 @@ private String[] toFirstRecordValues(final String expected, final CSVFormat form
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());
}
}

0 comments on commit 5d16917

Please sign in to comment.