Use try/multi-catch
Change-Id: Icf5042cccb0662d6bd53302800e03211af94c16d
This commit is contained in:
committed by
David Pursehouse
parent
8702786e5a
commit
64cfaf242d
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user