Skip to content

Commit 51c4d06

Browse files
committed
Clean up code formatting
1 parent 92b19ec commit 51c4d06

2 files changed

Lines changed: 32 additions & 18 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,9 @@ private String tryQuote(final String str, final char separator,
373373
final char quote)
374374
{
375375
if (str == null || str.length() == 0) return "" + quote + quote;
376-
if (str.indexOf(quote) != -1) return quote + str.replace("" + quote, "" +
377-
quote + quote) + quote;
376+
if (str.indexOf(quote) != -1) {
377+
return quote + str.replace("" + quote, "" + quote + quote) + quote;
378+
}
378379
if (str.indexOf(separator) != -1) return quote + str + quote;
379380
return str;
380381
}

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

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,51 +41,64 @@
4141
import org.scijava.table.Table;
4242

4343
@Plugin(type = Service.class)
44-
public class DefaultTableIOService extends AbstractTypedIOService<Table<?, ?>> implements
45-
TableIOService
44+
public class DefaultTableIOService extends AbstractTypedIOService<Table<?, ?>>
45+
implements TableIOService
4646
{
4747

4848
@Override
49-
public boolean canOpen(Location source) {
50-
IOPlugin<?> opener = ioService().getOpener(source);
49+
public boolean canOpen(final Location source) {
50+
final IOPlugin<?> opener = ioService().getOpener(source);
5151
if (opener == null) return false;
5252
return Table.class.isAssignableFrom(opener.getDataType());
5353
}
5454

5555
@Override
56-
public Table<?, ?> open(String source, TableIOOptions options) throws IOException {
56+
public Table<?, ?> open(final String source, final TableIOOptions options)
57+
throws IOException
58+
{
5759
try {
5860
return open(locationService().resolve(source), options);
59-
} catch (URISyntaxException e) {
61+
}
62+
catch (final URISyntaxException e) {
6063
throw new IOException(e);
6164
}
6265
}
6366

6467
@Override
65-
public Table<?, ?> open(Location source, TableIOOptions options) throws IOException {
66-
IOPlugin<?> opener = ioService().getOpener(source);
67-
if (opener != null && Table.class.isAssignableFrom(opener.getDataType())
68-
&& TableIOPlugin.class.isAssignableFrom(opener.getClass())) {
69-
return ((TableIOPlugin)opener).open(source, options);
68+
public Table<?, ?> open(final Location source, final TableIOOptions options)
69+
throws IOException
70+
{
71+
final IOPlugin<?> opener = ioService().getOpener(source);
72+
if (opener != null && Table.class.isAssignableFrom(opener.getDataType()) &&
73+
TableIOPlugin.class.isAssignableFrom(opener.getClass()))
74+
{
75+
return ((TableIOPlugin) opener).open(source, options);
7076
}
7177
throw new UnsupportedOperationException("No compatible opener found.");
7278
}
7379

7480
@Override
75-
public void save(Table<?, ?> table, String destination, TableIOOptions options) throws IOException {
81+
public void save(final Table<?, ?> table, final String destination,
82+
final TableIOOptions options) throws IOException
83+
{
7684
try {
7785
save(table, locationService().resolve(destination), options);
78-
} catch (URISyntaxException e) {
86+
}
87+
catch (final URISyntaxException e) {
7988
throw new IOException(e);
8089
}
8190
}
8291

8392
@Override
84-
public void save(Table<?, ?> table, Location destination, TableIOOptions options) throws IOException {
93+
public void save(final Table<?, ?> table, final Location destination,
94+
final TableIOOptions options) throws IOException
95+
{
8596
@SuppressWarnings("rawtypes")
8697
final IOPlugin<Table> saver = ioService().getSaver(table, destination);
87-
if (saver != null && TableIOPlugin.class.isAssignableFrom(saver.getClass())) {
88-
((TableIOPlugin)saver).save(table, destination, options);
98+
if (saver != null && TableIOPlugin.class.isAssignableFrom(saver
99+
.getClass()))
100+
{
101+
((TableIOPlugin) saver).save(table, destination, options);
89102
}
90103
else {
91104
throw new UnsupportedOperationException("No compatible saver found.");

0 commit comments

Comments
 (0)