Skip to content

Commit 375b273

Browse files
committed
No need for explicitly creating an array. Arrays.asList is a varargs method.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1512621 13f79535-47bb-0310-9956-ffa450edef68
1 parent c753458 commit 375b273

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public void testExcelPrintAllArrayOfArrays() throws IOException {
168168
public void testExcelPrintAllArrayOfLists() throws IOException {
169169
final StringWriter sw = new StringWriter();
170170
final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL);
171-
printer.printRecords(new List[] { Arrays.asList(new String[] { "r1c1", "r1c2" }), Arrays.asList(new String[] { "r2c1", "r2c2" }) });
171+
printer.printRecords(new List[] { Arrays.asList("r1c1", "r1c2"), Arrays.asList("r2c1", "r2c2") });
172172
assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString());
173173
printer.close();
174174
}
@@ -186,8 +186,8 @@ public void testExcelPrintAllIterableOfArrays() throws IOException {
186186
public void testExcelPrintAllIterableOfLists() throws IOException {
187187
final StringWriter sw = new StringWriter();
188188
final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL);
189-
printer.printRecords(Arrays.asList(new List[] { Arrays.asList(new String[] { "r1c1", "r1c2" }),
190-
Arrays.asList(new String[] { "r2c1", "r2c2" }) }));
189+
printer.printRecords(Arrays.asList(new List[] { Arrays.asList("r1c1", "r1c2"),
190+
Arrays.asList("r2c1", "r2c2") }));
191191
assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString());
192192
printer.close();
193193
}

0 commit comments

Comments
 (0)