diff --git a/History.md b/History.md index 9979a38edc..e0e42cb771 100644 --- a/History.md +++ b/History.md @@ -1,5 +1,6 @@ ## [Git master](https://github.com/cucumber/cucumber-jvm/compare/v1.1.1...master) +* [Core] Support `DataTable.toTable(List) and `DataTable.toTable(List>)` ([#433](https://github.com/cucumber/cucumber-jvm/issues/433), [#434](https://github.com/cucumber/cucumber-jvm/pull/434) Nicholas Albion, Aslak Hellesøy) * [Core] Formatters and `--dotcucumber` can now write to a file or an URL (via HTTP PUT). This allows easier distribution of reports. (Aslak Hellesøy) * [JUnit] Added `@Cucumber.Options.dotcucumber`, allowing metadata to be written from JUnit. Useful for code completion. ([#418](https://github.com/cucumber/cucumber-jvm/issues/418 Aslak Hellesøy) * [Core] Embedded data fails to display in HTML reports due to invalid string passed from HTMLFormatter ([#412](https://github.com/cucumber/cucumber-jvm/issues/412) Aslak Hellesøy) diff --git a/core/src/main/java/cucumber/api/DataTable.java b/core/src/main/java/cucumber/api/DataTable.java index 978dd3b56c..53cfbb9f35 100644 --- a/core/src/main/java/cucumber/api/DataTable.java +++ b/core/src/main/java/cucumber/api/DataTable.java @@ -32,16 +32,16 @@ public static DataTable create(List raw) { return create(raw, Locale.getDefault(), null, new String[0]); } - public static DataTable create(List raw, String dateFormat, String... columnNames) { - return create(raw, Locale.getDefault(), dateFormat, columnNames); + public static DataTable create(List raw, String format, String... columnNames) { + return create(raw, Locale.getDefault(), format, columnNames); } public static DataTable create(List raw, Locale locale, String... columnNames) { return create(raw, locale, null, columnNames); } - private static DataTable create(List raw, Locale locale, String dateFormat, String... columnNames) { - ParameterInfo parameterInfo = new ParameterInfo(null, dateFormat, null, null); + private static DataTable create(List raw, Locale locale, String format, String... columnNames) { + ParameterInfo parameterInfo = new ParameterInfo(null, format, null, null); TableConverter tableConverter = new TableConverter(new LocalizedXStreams(Thread.currentThread().getContextClassLoader()).get(locale), parameterInfo); return tableConverter.toTable(raw, columnNames); } @@ -74,7 +74,7 @@ public List> raw() { } public T convert(Type type) { - return tableConverter.convert(type, this); + return tableConverter.convert(type, this); } /** diff --git a/core/src/main/java/cucumber/runtime/table/TableConverter.java b/core/src/main/java/cucumber/runtime/table/TableConverter.java index 6aff447be5..bd05df183a 100644 --- a/core/src/main/java/cucumber/runtime/table/TableConverter.java +++ b/core/src/main/java/cucumber/runtime/table/TableConverter.java @@ -162,7 +162,7 @@ public List toList(final Type type, DataTable dataTable) { * Converts a List of objects to a DataTable. * * @param objects the objects to convert - * @param columnNames an explicit list of column names (currently not used) + * @param columnNames an explicit list of column names * @return a DataTable */ public DataTable toTable(List objects, String... columnNames) {