Use try/multi-catch

Change-Id: Icf5042cccb0662d6bd53302800e03211af94c16d
This commit is contained in:
Urs Wolfer
2015-06-24 20:06:25 +02:00
committed by David Pursehouse
parent 8702786e5a
commit 64cfaf242d
39 changed files with 51 additions and 174 deletions

View File

@@ -31,15 +31,9 @@ public class ConfigUtil {
private static <T> T[] allValuesOf(final T defaultValue) {
try {
return (T[]) defaultValue.getClass().getMethod("values").invoke(null);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Cannot obtain enumeration values", e);
} catch (SecurityException e) {
throw new IllegalArgumentException("Cannot obtain enumeration values", e);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Cannot obtain enumeration values", e);
} catch (InvocationTargetException e) {
throw new IllegalArgumentException("Cannot obtain enumeration values", e);
} catch (NoSuchMethodException e) {
} catch (IllegalArgumentException | NoSuchMethodException
| InvocationTargetException | IllegalAccessException
| SecurityException e) {
throw new IllegalArgumentException("Cannot obtain enumeration values", e);
}
}