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
The following commit(s) were added to refs/heads/master by this push:
new a34ceda Use varargs.
a34ceda is described below
commit a34cedaca754494101aef22e45fff0fee74a22fb
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Feb 28 16:23:41 2021 -0500
Use varargs.
---
src/test/java/org/apache/commons/csv/CSVFormatTest.java | 16 ++++++++--------
src/test/java/org/apache/commons/csv/CSVPrinterTest.java | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/test/java/org/apache/commons/csv/CSVFormatTest.java
b/src/test/java/org/apache/commons/csv/CSVFormatTest.java
index 7290075..d9de99f 100644
--- a/src/test/java/org/apache/commons/csv/CSVFormatTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVFormatTest.java
@@ -166,28 +166,28 @@ public class CSVFormatTest {
for (final Class<?> cls : method.getParameterTypes()) {
final String type = cls.getCanonicalName();
if ("boolean".equals(type)) {
- final Object defTrue =
method.invoke(CSVFormat.DEFAULT, new Object[] {Boolean.TRUE});
- final Object defFalse =
method.invoke(CSVFormat.DEFAULT, new Object[] {Boolean.FALSE});
+ final Object defTrue =
method.invoke(CSVFormat.DEFAULT, Boolean.TRUE);
+ final Object defFalse =
method.invoke(CSVFormat.DEFAULT, Boolean.FALSE);
assertNotEquals(name, type ,defTrue, defFalse);
} else if ("char".equals(type)){
- final Object a = method.invoke(CSVFormat.DEFAULT,
new Object[] {'a'});
- final Object b = method.invoke(CSVFormat.DEFAULT,
new Object[] {'b'});
+ final Object a = method.invoke(CSVFormat.DEFAULT,
'a');
+ final Object b = method.invoke(CSVFormat.DEFAULT,
'b');
assertNotEquals(name, type, a, b);
} else if ("java.lang.Character".equals(type)){
final Object a = method.invoke(CSVFormat.DEFAULT,
new Object[] {null});
- final Object b = method.invoke(CSVFormat.DEFAULT,
new Object[] {new Character('d')});
+ final Object b = method.invoke(CSVFormat.DEFAULT,
new Character('d'));
assertNotEquals(name, type, a, b);
} else if ("java.lang.String".equals(type)){
final Object a = method.invoke(CSVFormat.DEFAULT,
new Object[] {null});
- final Object b = method.invoke(CSVFormat.DEFAULT,
new Object[] {"e"});
+ final Object b = method.invoke(CSVFormat.DEFAULT,
"e");
assertNotEquals(name, type, a, b);
} else if ("java.lang.String[]".equals(type)){
final Object a = method.invoke(CSVFormat.DEFAULT,
new Object[] {new String[] {null, null}});
final Object b = method.invoke(CSVFormat.DEFAULT,
new Object[] {new String[] {"f", "g"}});
assertNotEquals(name, type, a, b);
} else if
("org.apache.commons.csv.QuoteMode".equals(type)){
- final Object a = method.invoke(CSVFormat.DEFAULT,
new Object[] {QuoteMode.MINIMAL});
- final Object b = method.invoke(CSVFormat.DEFAULT,
new Object[] {QuoteMode.ALL});
+ final Object a = method.invoke(CSVFormat.DEFAULT,
QuoteMode.MINIMAL);
+ final Object b = method.invoke(CSVFormat.DEFAULT,
QuoteMode.ALL);
assertNotEquals(name, type, a, b);
} else if ("java.lang.Object[]".equals(type)){
final Object a = method.invoke(CSVFormat.DEFAULT,
new Object[] {new Object[] {null, null}});
diff --git a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
index 120c857..16712ae 100644
--- a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
@@ -547,7 +547,7 @@ public class CSVPrinterTest {
final StringWriter sw = new StringWriter();
try (final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
printer.printRecords(
- Arrays.asList(new List[] { Arrays.asList("r1c1", "r1c2"),
Arrays.asList("r2c1", "r2c2") }));
+ Arrays.asList(Arrays.asList("r1c1", "r1c2"),
Arrays.asList("r2c1", "r2c2")));
assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" +
recordSeparator, sw.toString());
}
}