This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-csv.git

commit 5d16917835d11da3b07d68b6658447988f76200d
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Jul 3 16:40:37 2021 -0400

    Use try-with-resources. Better local var name.
---
 src/test/java/org/apache/commons/csv/CSVPrinterTest.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java 
b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
index 4d60a3b..c5680b7 100644
--- a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
@@ -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());
     }
 }

Reply via email to