LANG-1279: Update Java requirement from Java 6 to 7

use multi-catch in AnnotationUtils and ExceptionUtils
This commit is contained in:
pascalschumacher 2016-10-23 22:40:07 +02:00
parent f9cab271b3
commit 383bc8eefa
2 changed files with 3 additions and 11 deletions

View File

@ -143,9 +143,7 @@ && isValidAnnotationMemberType(m.getReturnType())) {
}
}
}
} catch (final IllegalAccessException ex) {
return false;
} catch (final InvocationTargetException ex) {
} catch (final IllegalAccessException | InvocationTargetException ex) {
return false;
}
return true;

View File

@ -198,20 +198,14 @@ private static Throwable getCauseUsingMethodName(final Throwable throwable, fina
Method method = null;
try {
method = throwable.getClass().getMethod(methodName);
} catch (final NoSuchMethodException ignored) { // NOPMD
// exception ignored
} catch (final SecurityException ignored) { // NOPMD
} catch (final NoSuchMethodException | SecurityException ignored) { // NOPMD
// exception ignored
}
if (method != null && Throwable.class.isAssignableFrom(method.getReturnType())) {
try {
return (Throwable) method.invoke(throwable);
} catch (final IllegalAccessException ignored) { // NOPMD
// exception ignored
} catch (final IllegalArgumentException ignored) { // NOPMD
// exception ignored
} catch (final InvocationTargetException ignored) { // NOPMD
} catch (final IllegalAccessException | IllegalArgumentException | InvocationTargetException ignored) { // NOPMD
// exception ignored
}
}