mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-09 19:45:01 +00:00
LANG-1279: Update Java requirement from Java 6 to 7
use multi-catch in AnnotationUtils and ExceptionUtils
This commit is contained in:
parent
f9cab271b3
commit
383bc8eefa
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user