Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Commit e0ddc57

Browse files
committed
Remove unused code and comments
* opting against guessing whether row and / or column headers exist in favor of predictable and deterministic behavior
1 parent 20b0d65 commit e0ddc57

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

src/main/java/org/scijava/table/DefaultTableIOPlugin.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -269,17 +269,7 @@ static Function<String, Object> guessParser(String content) {
269269
@Override
270270
public void save(final Table table, final String destination)
271271
throws IOException {
272-
TableIOOptions options = new TableIOOptions();
273-
// DISCUSS if we guess at his point if column or row headers should be written, the plugin will behave differently
274-
// if you call save(table, destination) vs. save(table, destination, new TableIOOptions())
275-
// .. and this seems just wrong.
276-
// options.writeColHeaders(table.getColumnCount() > 0 && //
277-
// IntStream.range(0, table.getColumnCount()).allMatch(col -> table
278-
// .getColumnHeader(col) != null));
279-
// options.writeRowHeaders(table.getRowCount() > 0 && //
280-
// IntStream.range(0, table.getRowCount()).allMatch(row -> table
281-
// .getRowHeader(row) != null));
282-
save(table, destination, options.values);
272+
save(table, destination, new TableIOOptions().values);
283273
}
284274

285275
@Override

src/test/java/org/scijava/table/DefaultTableIOPluginTest.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -311,21 +311,6 @@ private String saveTable(final Table table,
311311
return result;
312312
}
313313

314-
private void setValues(final Object instance, final String[] fieldNames,
315-
final Object[] values) throws SecurityException
316-
{
317-
final Class<?> cls = instance.getClass();
318-
final List<Field> fields = ClassUtils.getAnnotatedFields(cls,
319-
Parameter.class);
320-
final HashMap<String, Field> fieldMap = new HashMap<>();
321-
for (final Field field : fields) {
322-
fieldMap.put(field.getName(), field);
323-
}
324-
for (int i = 0; i < fieldNames.length; i++) {
325-
ClassUtils.setValue(fieldMap.get(fieldNames[i]), instance, values[i]);
326-
}
327-
}
328-
329314
private String makeTableSource(final String[][] cells, final String separator,
330315
final String eol)
331316
{

0 commit comments

Comments
 (0)