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
This commit is contained in:
parent
c75345870e
commit
375b273ced
|
@ -168,7 +168,7 @@ public class CSVPrinterTest {
|
||||||
public void testExcelPrintAllArrayOfLists() throws IOException {
|
public void testExcelPrintAllArrayOfLists() throws IOException {
|
||||||
final StringWriter sw = new StringWriter();
|
final StringWriter sw = new StringWriter();
|
||||||
final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL);
|
final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL);
|
||||||
printer.printRecords(new List[] { Arrays.asList(new String[] { "r1c1", "r1c2" }), Arrays.asList(new String[] { "r2c1", "r2c2" }) });
|
printer.printRecords(new List[] { Arrays.asList("r1c1", "r1c2"), Arrays.asList("r2c1", "r2c2") });
|
||||||
assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString());
|
assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString());
|
||||||
printer.close();
|
printer.close();
|
||||||
}
|
}
|
||||||
|
@ -186,8 +186,8 @@ public class CSVPrinterTest {
|
||||||
public void testExcelPrintAllIterableOfLists() throws IOException {
|
public void testExcelPrintAllIterableOfLists() throws IOException {
|
||||||
final StringWriter sw = new StringWriter();
|
final StringWriter sw = new StringWriter();
|
||||||
final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL);
|
final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL);
|
||||||
printer.printRecords(Arrays.asList(new List[] { Arrays.asList(new String[] { "r1c1", "r1c2" }),
|
printer.printRecords(Arrays.asList(new List[] { Arrays.asList("r1c1", "r1c2"),
|
||||||
Arrays.asList(new String[] { "r2c1", "r2c2" }) }));
|
Arrays.asList("r2c1", "r2c2") }));
|
||||||
assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString());
|
assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString());
|
||||||
printer.close();
|
printer.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue