Skip to content

Commit 4235519

Browse files
committed
GatewayPreprocessor: use try/multi-catch
1 parent 466d0aa commit 4235519

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/main/java/org/scijava/module/process/GatewayPreprocessor.java

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,10 @@ private <G extends Gateway> void setGatewayValue(final Context context,
8787
try {
8888
gateway = type.getConstructor(Context.class).newInstance(context);
8989
}
90-
catch (final IllegalArgumentException exc) {
91-
exception = exc;
92-
}
93-
catch (final SecurityException exc) {
94-
exception = exc;
95-
}
96-
catch (final InstantiationException exc) {
97-
exception = exc;
98-
}
99-
catch (final IllegalAccessException exc) {
100-
exception = exc;
101-
}
102-
catch (final InvocationTargetException exc) {
103-
exception = exc;
104-
}
105-
catch (final NoSuchMethodException exc) {
90+
catch (final IllegalArgumentException | SecurityException
91+
| InstantiationException | IllegalAccessException
92+
| InvocationTargetException | NoSuchMethodException exc)
93+
{
10694
exception = exc;
10795
}
10896
if (exception != null) {

0 commit comments

Comments
 (0)