Skip to content

Commit 92b19ec

Browse files
committed
Fix warnings
1 parent 9e4b376 commit 92b19ec

5 files changed

Lines changed: 34 additions & 16 deletions

File tree

src/main/java/org/scijava/table/io/DefaultTableIOService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535

3636
import org.scijava.io.AbstractTypedIOService;
3737
import org.scijava.io.IOPlugin;
38-
import org.scijava.io.IOService;
3938
import org.scijava.io.location.Location;
40-
import org.scijava.plugin.Parameter;
4139
import org.scijava.plugin.Plugin;
4240
import org.scijava.service.Service;
4341
import org.scijava.table.Table;
@@ -84,7 +82,8 @@ public void save(Table<?, ?> table, String destination, TableIOOptions options)
8482

8583
@Override
8684
public void save(Table<?, ?> table, Location destination, TableIOOptions options) throws IOException {
87-
IOPlugin<Table> saver = ioService().getSaver(table, destination);
85+
@SuppressWarnings("rawtypes")
86+
final IOPlugin<Table> saver = ioService().getSaver(table, destination);
8887
if (saver != null && TableIOPlugin.class.isAssignableFrom(saver.getClass())) {
8988
((TableIOPlugin)saver).save(table, destination, options);
9089
}

src/main/java/org/scijava/table/io/TableIOOptions.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,10 @@ public Function<Object, String> formatter() {
282282
* @return the values of this column's options
283283
*/
284284
public ColumnTableIOOptions.Values column(int column) {
285-
ColumnTableIOOptions columnOptions = getValueOrDefault(columnOptionsKey, new HashMap<Integer, ColumnTableIOOptions>()).get(column);
286-
if(columnOptions == null) return null;
287-
return columnOptions.values;
285+
ColumnTableIOOptions colOpts = getValueOrDefault(columnOptionsKey,
286+
new HashMap<Integer, ColumnTableIOOptions>()).get(column);
287+
if (colOpts == null) return null;
288+
return colOpts.values;
288289
}
289290
}
290291
}

src/main/java/org/scijava/table/io/TableIOPlugin.java

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,35 @@
3030

3131
package org.scijava.table.io;
3232

33+
import java.io.IOException;
34+
3335
import org.scijava.io.IOPlugin;
3436
import org.scijava.io.location.Location;
3537
import org.scijava.table.Table;
3638

37-
import java.io.IOException;
38-
3939
/**
4040
* Abstract plugin class for saving and loading tables
4141
*
4242
* @author Deborah Schmidt
4343
*/
44+
@SuppressWarnings("rawtypes")
4445
public interface TableIOPlugin extends IOPlugin<Table> {
4546

4647
@Override
4748
default Table<?, ?> open(Location source) throws IOException {
4849
return open(source, new TableIOOptions());
4950
}
5051

51-
/** Opens data from the given source. */
52-
default Table<?, ?> open(final Location source, final TableIOOptions options) throws IOException {
52+
/**
53+
* Opens data from the given source.
54+
*
55+
* @param source The data source to open as a table.
56+
* @param options The options to use when opening the data.
57+
* @throws IOException If something goes wrong opening the data source.
58+
*/
59+
default Table<?, ?> open(final Location source, final TableIOOptions options)
60+
throws IOException
61+
{
5362
throw new UnsupportedOperationException();
5463
}
5564

@@ -58,8 +67,17 @@ default void save(Table data, Location destination) throws IOException {
5867
save(data, destination, new TableIOOptions());
5968
}
6069

61-
/** Saves the given data to the specified destination. */
62-
default void save(final Table<?, ?> data, final Location destination, final TableIOOptions options) throws IOException {
70+
/**
71+
* Saves the given data to the specified destination.
72+
*
73+
* @param data The table to save.
74+
* @param destination The destination where the table should be saved.
75+
* @param options The options to use when saving the data.
76+
* @throws IOException If something goes wrong opening the data source.
77+
*/
78+
default void save(final Table<?, ?> data, final Location destination,
79+
final TableIOOptions options) throws IOException
80+
{
6381
throw new UnsupportedOperationException();
6482
}
6583

src/main/java/org/scijava/table/io/TableIOService.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@
3232

3333
import java.io.IOException;
3434

35-
import org.scijava.io.IOService;
3635
import org.scijava.io.TypedIOService;
3736
import org.scijava.io.location.Location;
38-
import org.scijava.service.SciJavaService;
3937
import org.scijava.table.Table;
4038

4139
public interface TableIOService extends TypedIOService<Table<?, ?>> {

src/test/java/org/scijava/table/io/TableIOServiceTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,12 @@ public boolean supportsSave(Location loc) {
122122
}
123123

124124
/**
125-
* This method creates a fake table for the purpose of testing the propagation of options.
126-
* It creates a row and a column with header names based on the {@param options}.
125+
* This method creates a fake table for the purpose of testing the
126+
* propagation of options. It creates a row and a column with header names
127+
* based on the {@code options}.
127128
*/
128129
@Override
130+
@SuppressWarnings("unchecked")
129131
public Table open(Location loc, TableIOOptions options) {
130132
DefaultGenericTable table = new DefaultGenericTable();
131133
if(options.values.readColumnHeaders()) {

0 commit comments

Comments
 (0)