Skip to content

Commit

Permalink
Refine logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Dec 10, 2021
1 parent f717ad7 commit 87300dd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public static Object newInstance(Class<?> clazz, Object... initargs) throws NoSu
unsafe.putLong(ctor, methodOffset, method);
unsafe.putObject(ctor, classOffset, clazz);
Class<?>[] params = ctor.getParameterTypes();
if (!checkArgsForInvokeMethod(params, initargs)) continue;
return ctor.newInstance(initargs);
if (checkArgsForInvokeMethod(params, initargs))
return ctor.newInstance(initargs);
}
}
throw new NoSuchMethodException("Cannot find matching method");
Expand Down Expand Up @@ -156,8 +156,8 @@ public static Object invoke(Class<?> clazz, Object thiz, String methodName, Obje
"(" + Arrays.stream(stub.getParameterTypes()).map(Type::getTypeName).collect(Collectors.joining()) + ")");
if (methodName.equals(stub.getName())) {
Class<?>[] params = stub.getParameterTypes();
if (!checkArgsForInvokeMethod(params, args)) continue;
return stub.invoke(thiz, args);
if (checkArgsForInvokeMethod(params, args))
return stub.invoke(thiz, args);
}
}
throw new NoSuchMethodException("Cannot find matching method");
Expand Down

0 comments on commit 87300dd

Please sign in to comment.