Use try/multi-catch for some reflection-related exceptions

There are more places in the code that could benefit from this but
these are particularly egregious and easy to spot.

Change-Id: Iccef1e03e6c36bb83bf6dc1397f54817dd05af33
This commit is contained in:
Dave Borowitz
2013-12-27 13:02:28 -08:00
parent a76877cfb0
commit 2cc91e481d
3 changed files with 11 additions and 39 deletions

View File

@@ -156,10 +156,7 @@ public final class GerritLauncher {
final Method main;
try {
main = clazz.getMethod("main", argv.getClass());
} catch (SecurityException e) {
System.err.println("fatal: unknown command " + name);
return 1;
} catch (NoSuchMethodException e) {
} catch (SecurityException | NoSuchMethodException e) {
System.err.println("fatal: unknown command " + name);
return 1;
}