test_class.declarator: invoker
test_class.modifier: private
test_class.original_string: private Invoker<?> invoker;
test_class.type: Invoker<?>
test_class.var_name: invoker
test_class.declarator: invokerInvocationHandler
test_class.modifier: private
test_class.original_string: private InvokerInvocationHandler invokerInvocationHandler;
test_class.type: InvokerInvocationHandler
test_class.var_name: invokerInvocationHandler
test_class.file: dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/proxy/InvokerInvocationHandlerTest.java
test_class.identifier: InvokerInvocationHandlerTest
test_case.body: @Test
      public void testInvokeToString() throws Throwable {
          String methodName = "toString";
  
          when(invoker.toString()).thenReturn(methodName);
          Method method = invoker.getClass().getMethod(methodName);
  
          Object result = invokerInvocationHandler.invoke(null, method, new Object[]{});
          Assertions.assertEquals(methodName, result);
      }
test_case.class_method_signature: InvokerInvocationHandlerTest.testInvokeToString()
test_case.full_signature: @Test public void testInvokeToString()
test_case.identifier: testInvokeToString
test_case.invocations: thenReturn when toString getMethod getClass invoke assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInvokeToString()
focal_class.declarator: logger = LoggerFactory.getLogger(InvokerInvocationHandler.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(InvokerInvocationHandler.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: invoker
focal_class.modifier: private final
focal_class.original_string: private final Invoker<?> invoker;
focal_class.type: Invoker<?>
focal_class.var_name: invoker
focal_class.declarator: consumerModel
focal_class.modifier: private
focal_class.original_string: private ConsumerModel consumerModel;
focal_class.type: ConsumerModel
focal_class.var_name: consumerModel
focal_class.declarator: url
focal_class.modifier: private
focal_class.original_string: private URL url;
focal_class.type: URL
focal_class.var_name: url
focal_class.declarator: protocolServiceKey
focal_class.modifier: private
focal_class.original_string: private String protocolServiceKey;
focal_class.type: String
focal_class.var_name: protocolServiceKey
focal_class.file: dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/proxy/InvokerInvocationHandler.java
focal_class.identifier: InvokerInvocationHandler
focal_class.interfaces: implements InvocationHandler
focal_class.class_method_signature: InvokerInvocationHandler.InvokerInvocationHandler(Invoker<?> handler)
focal_class.full_signature: public  InvokerInvocationHandler(Invoker<?> handler)
focal_class.identifier: InvokerInvocationHandler
focal_class.modifiers: public
focal_class.parameters: (Invoker<?> handler)
focal_class.signature:  InvokerInvocationHandler(Invoker<?> handler)
focal_class.class_method_signature: InvokerInvocationHandler.invoke(Object proxy, Method method, Object[] args)
focal_class.full_signature: @Override public Object invoke(Object proxy, Method method, Object[] args)
focal_class.identifier: invoke
focal_class.modifiers: @Override public
focal_class.parameters: (Object proxy, Method method, Object[] args)
focal_class.return: Object
focal_class.signature: Object invoke(Object proxy, Method method, Object[] args)
focal_method.body: @Override
      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
          if (method.getDeclaringClass() == Object.class) {
              return method.invoke(invoker, args);
          }
          String methodName = method.getName();
          Class<?>[] parameterTypes = method.getParameterTypes();
          if (parameterTypes.length == 0) {
              if ("toString".equals(methodName)) {
                  return invoker.toString();
              } else if ("$destroy".equals(methodName)) {
                  invoker.destroy();
                  return null;
              } else if ("hashCode".equals(methodName)) {
                  return invoker.hashCode();
              }
          } else if (parameterTypes.length == 1 && "equals".equals(methodName)) {
              return invoker.equals(args[0]);
          }
          RpcInvocation rpcInvocation = new RpcInvocation(method, invoker.getInterface().getName(), protocolServiceKey, args);
          String serviceKey = invoker.getUrl().getServiceKey();
          rpcInvocation.setTargetServiceUniqueName(serviceKey);
  
          // invoker.getUrl() returns consumer url.
          RpcContext.setRpcContext(invoker.getUrl());
  
          if (consumerModel != null) {
              rpcInvocation.put(Constants.CONSUMER_MODEL, consumerModel);
              rpcInvocation.put(Constants.METHOD_MODEL, consumerModel.getMethodModel(method));
          }
  
          return invoker.invoke(rpcInvocation).recreate();
      }
focal_method.class_method_signature: InvokerInvocationHandler.invoke(Object proxy, Method method, Object[] args)
focal_method.full_signature: @Override public Object invoke(Object proxy, Method method, Object[] args)
focal_method.identifier: invoke
focal_method.invocations: getDeclaringClass invoke getName getParameterTypes equals toString equals destroy equals hashCode equals equals getName getInterface getServiceKey getUrl setTargetServiceUniqueName setRpcContext getUrl put put getMethodModel recreate invoke
focal_method.modifiers: @Override public
focal_method.parameters: (Object proxy, Method method, Object[] args)
focal_method.return: Object
focal_method.signature: Object invoke(Object proxy, Method method, Object[] args)