commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1512621 - /commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
Date Sat, 10 Aug 2013 10:57:32 GMT
Author: britter
Date: Sat Aug 10 10:57:32 2013
New Revision: 1512621

URL: http://svn.apache.org/r1512621
Log:
No need for explicitly creating an array. Arrays.asList is a varargs method.

Modified:
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java

Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java?rev=1512621&r1=1512620&r2=1512621&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java (original)
+++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java Sat
Aug 10 10:57:32 2013
@@ -168,7 +168,7 @@ public class CSVPrinterTest {
     public void testExcelPrintAllArrayOfLists() throws IOException {
         final StringWriter sw = new StringWriter();
         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());
         printer.close();
     }
@@ -186,8 +186,8 @@ public class CSVPrinterTest {
     public void testExcelPrintAllIterableOfLists() throws IOException {
         final StringWriter sw = new StringWriter();
         final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL);
-        printer.printRecords(Arrays.asList(new List[] { Arrays.asList(new String[] { "r1c1",
"r1c2" }),
-                Arrays.asList(new String[] { "r2c1", "r2c2" }) }));
+        printer.printRecords(Arrays.asList(new List[] { Arrays.asList("r1c1", "r1c2"),
+                Arrays.asList("r2c1", "r2c2") }));
         assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString());
         printer.close();
     }



Mime
View raw message