Cast null for calling getMethods() [Eclipse]
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@753650 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
43db58d70f
commit
63f03f356c
|
@ -87,7 +87,7 @@ public class ExceptionUtils {
|
||||||
static {
|
static {
|
||||||
Method causeMethod;
|
Method causeMethod;
|
||||||
try {
|
try {
|
||||||
causeMethod = Throwable.class.getMethod("getCause", null);
|
causeMethod = Throwable.class.getMethod("getCause", (Class[]) null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
causeMethod = null;
|
causeMethod = null;
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ public class ExceptionUtils {
|
||||||
private static Throwable getCauseUsingMethodName(Throwable throwable, String methodName) {
|
private static Throwable getCauseUsingMethodName(Throwable throwable, String methodName) {
|
||||||
Method method = null;
|
Method method = null;
|
||||||
try {
|
try {
|
||||||
method = throwable.getClass().getMethod(methodName, null);
|
method = throwable.getClass().getMethod(methodName, (Class[]) null);
|
||||||
} catch (NoSuchMethodException ignored) {
|
} catch (NoSuchMethodException ignored) {
|
||||||
// exception ignored
|
// exception ignored
|
||||||
} catch (SecurityException ignored) {
|
} catch (SecurityException ignored) {
|
||||||
|
@ -471,7 +471,7 @@ public class ExceptionUtils {
|
||||||
synchronized(CAUSE_METHOD_NAMES) {
|
synchronized(CAUSE_METHOD_NAMES) {
|
||||||
for (int i = 0, isize = CAUSE_METHOD_NAMES.length; i < isize; i++) {
|
for (int i = 0, isize = CAUSE_METHOD_NAMES.length; i < isize; i++) {
|
||||||
try {
|
try {
|
||||||
Method method = cls.getMethod(CAUSE_METHOD_NAMES[i], null);
|
Method method = cls.getMethod(CAUSE_METHOD_NAMES[i], (Class[]) null);
|
||||||
if (method != null && Throwable.class.isAssignableFrom(method.getReturnType())) {
|
if (method != null && Throwable.class.isAssignableFrom(method.getReturnType())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue