Skip to content

Commit 43478c1

Browse files
authored
Fix RpcUtils by getting method from invokerInterface if it is not null (#15477)
1 parent e140c06 commit 43478c1

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support

dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/RpcUtils.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,7 @@ public static boolean isOneway(URL url, Invocation inv) {
244244

245245
private static Method getMethodByService(Invocation invocation, String service) throws NoSuchMethodException {
246246
Class<?> invokerInterface = invocation.getInvoker().getInterface();
247-
Class<?> cls = invokerInterface != null
248-
? ReflectUtils.forName(invokerInterface.getClassLoader(), service)
249-
: ReflectUtils.forName(service);
247+
Class<?> cls = invokerInterface != null ? invokerInterface : ReflectUtils.forName(service);
250248
Method method = cls.getMethod(invocation.getMethodName(), invocation.getParameterTypes());
251249
if (method.getReturnType() == void.class) {
252250
return null;

0 commit comments

Comments
 (0)