Skip to content

Commit

Permalink
fix AutoJsonRpcClientProxyCreator can't not override the json-rpc method
Browse files Browse the repository at this point in the history
  • Loading branch information
vm-001 committed Jul 17, 2019
1 parent d438415 commit 33fae5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private static boolean isDeclaringClassAnObject(Method method) {
return method.getDeclaringClass() == Object.class;
}

private static String getMethodName(Method method) {
public static String getMethodName(Method method) {
final JsonRpcMethod jsonRpcMethod = ReflectionUtil.getAnnotation(method, JsonRpcMethod.class);
if (jsonRpcMethod == null) {
return method.getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.googlecode.jsonrpc4j.JsonRpcClient.RequestListener;
import com.googlecode.jsonrpc4j.ExceptionResolver;
import com.googlecode.jsonrpc4j.JsonRpcHttpClient;
import com.googlecode.jsonrpc4j.ProxyUtil;
import com.googlecode.jsonrpc4j.ReflectionUtil;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
Expand Down Expand Up @@ -104,7 +105,7 @@ public Object invoke(MethodInvocation invocation)
Type retType = (invocation.getMethod().getGenericReturnType() != null) ? invocation.getMethod().getGenericReturnType() : invocation.getMethod().getReturnType();
Object arguments = ReflectionUtil.parseArguments(invocation.getMethod(), invocation.getArguments());

return jsonRpcHttpClient.invoke(invocation.getMethod().getName(), arguments, retType, extraHttpHeaders);
return jsonRpcHttpClient.invoke(ProxyUtil.getMethodName(method), arguments, retType, extraHttpHeaders);
}

/**
Expand Down

0 comments on commit 33fae5c

Please sign in to comment.