test_class.file: dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/RpcUtilsTest.java
test_class.identifier: RpcUtilsTest
test_case.body: @Test
      public void testGetParameterTypes() {
          Class<?> demoServiceClass = DemoService.class;
          String serviceName = demoServiceClass.getName();
          Invoker invoker = mock(Invoker.class);
  
          // void sayHello(String name);
          RpcInvocation inv1 = new RpcInvocation("sayHello", serviceName, "",
                  new Class<?>[]{String.class}, null, null, invoker, null);
          Class<?>[] parameterTypes1 = RpcUtils.getParameterTypes(inv1);
          Assertions.assertNotNull(parameterTypes1);
          Assertions.assertEquals(1, parameterTypes1.length);
          Assertions.assertEquals(String.class, parameterTypes1[0]);
  
          //long timestamp();
          RpcInvocation inv2 = new RpcInvocation("timestamp", serviceName, "", null, null, null, invoker, null);
          Class<?>[] parameterTypes2 = RpcUtils.getParameterTypes(inv2);
          Assertions.assertEquals(0, parameterTypes2.length);
  
          //Type enumlength(Type... types);
          RpcInvocation inv3 = new RpcInvocation("enumlength", serviceName, "",
                  new Class<?>[]{Type.class, Type.class}, null, null, invoker, null);
          Class<?>[] parameterTypes3 = RpcUtils.getParameterTypes(inv3);
          Assertions.assertNotNull(parameterTypes3);
          Assertions.assertEquals(2, parameterTypes3.length);
          Assertions.assertEquals(Type.class, parameterTypes3[0]);
          Assertions.assertEquals(Type.class, parameterTypes3[1]);
  
          //byte getbyte(byte arg);
          RpcInvocation inv4 = new RpcInvocation("getbyte", serviceName, "",
                  new Class<?>[]{byte.class}, null, null, invoker, null);
          Class<?>[] parameterTypes4 = RpcUtils.getParameterTypes(inv4);
          Assertions.assertNotNull(parameterTypes4);
          Assertions.assertEquals(1, parameterTypes4.length);
          Assertions.assertEquals(byte.class, parameterTypes4[0]);
  
          //void $invoke(String s1, String s2);
          RpcInvocation inv5 = new RpcInvocation("$invoke", serviceName, "",
                  new Class<?>[]{String.class, String[].class},
                  new Object[]{"method", new String[]{"java.lang.String", "void", "java.lang.Object"}},
                  null, invoker, null);
          Class<?>[] parameterTypes5 = RpcUtils.getParameterTypes(inv5);
          Assertions.assertNotNull(parameterTypes5);
          Assertions.assertEquals(3, parameterTypes5.length);
          Assertions.assertEquals(String.class, parameterTypes5[0]);
          Assertions.assertEquals(String.class, parameterTypes5[1]);
          Assertions.assertEquals(String.class, parameterTypes5[2]);
      }
test_case.class_method_signature: RpcUtilsTest.testGetParameterTypes()
test_case.full_signature: @Test public void testGetParameterTypes()
test_case.identifier: testGetParameterTypes
test_case.invocations: getName mock getParameterTypes assertNotNull assertEquals assertEquals getParameterTypes assertEquals getParameterTypes assertNotNull assertEquals assertEquals assertEquals getParameterTypes assertNotNull assertEquals assertEquals getParameterTypes assertNotNull assertEquals assertEquals assertEquals assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetParameterTypes()
focal_class.declarator: logger = LoggerFactory.getLogger(RpcUtils.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(RpcUtils.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: INVOKE_ID = new AtomicLong(0)
focal_class.modifier: private static final
focal_class.original_string: private static final AtomicLong INVOKE_ID = new AtomicLong(0);
focal_class.type: AtomicLong
focal_class.var_name: INVOKE_ID
focal_class.file: dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/RpcUtils.java
focal_class.identifier: RpcUtils
focal_class.class_method_signature: RpcUtils.getReturnType(Invocation invocation)
focal_class.full_signature: public static Class<?> getReturnType(Invocation invocation)
focal_class.identifier: getReturnType
focal_class.modifiers: public static
focal_class.parameters: (Invocation invocation)
focal_class.return: Class<?>
focal_class.signature: Class<?> getReturnType(Invocation invocation)
focal_class.class_method_signature: RpcUtils.getReturnTypes(Invocation invocation)
focal_class.full_signature: public static Type[] getReturnTypes(Invocation invocation)
focal_class.identifier: getReturnTypes
focal_class.modifiers: public static
focal_class.parameters: (Invocation invocation)
focal_class.return: Type[]
focal_class.signature: Type[] getReturnTypes(Invocation invocation)
focal_class.class_method_signature: RpcUtils.getInvocationId(Invocation inv)
focal_class.full_signature: public static Long getInvocationId(Invocation inv)
focal_class.identifier: getInvocationId
focal_class.modifiers: public static
focal_class.parameters: (Invocation inv)
focal_class.return: Long
focal_class.signature: Long getInvocationId(Invocation inv)
focal_class.class_method_signature: RpcUtils.attachInvocationIdIfAsync(URL url, Invocation inv)
focal_class.full_signature: public static void attachInvocationIdIfAsync(URL url, Invocation inv)
focal_class.identifier: attachInvocationIdIfAsync
focal_class.modifiers: public static
focal_class.parameters: (URL url, Invocation inv)
focal_class.return: void
focal_class.signature: void attachInvocationIdIfAsync(URL url, Invocation inv)
focal_class.class_method_signature: RpcUtils.isAttachInvocationId(URL url, Invocation invocation)
focal_class.full_signature: private static boolean isAttachInvocationId(URL url, Invocation invocation)
focal_class.identifier: isAttachInvocationId
focal_class.modifiers: private static
focal_class.parameters: (URL url, Invocation invocation)
focal_class.return: boolean
focal_class.signature: boolean isAttachInvocationId(URL url, Invocation invocation)
focal_class.class_method_signature: RpcUtils.getMethodName(Invocation invocation)
focal_class.full_signature: public static String getMethodName(Invocation invocation)
focal_class.identifier: getMethodName
focal_class.modifiers: public static
focal_class.parameters: (Invocation invocation)
focal_class.return: String
focal_class.signature: String getMethodName(Invocation invocation)
focal_class.class_method_signature: RpcUtils.getArguments(Invocation invocation)
focal_class.full_signature: public static Object[] getArguments(Invocation invocation)
focal_class.identifier: getArguments
focal_class.modifiers: public static
focal_class.parameters: (Invocation invocation)
focal_class.return: Object[]
focal_class.signature: Object[] getArguments(Invocation invocation)
focal_class.class_method_signature: RpcUtils.getParameterTypes(Invocation invocation)
focal_class.full_signature: public static Class<?>[] getParameterTypes(Invocation invocation)
focal_class.identifier: getParameterTypes
focal_class.modifiers: public static
focal_class.parameters: (Invocation invocation)
focal_class.return: Class<?>[]
focal_class.signature: Class<?>[] getParameterTypes(Invocation invocation)
focal_class.class_method_signature: RpcUtils.isAsync(URL url, Invocation inv)
focal_class.full_signature: public static boolean isAsync(URL url, Invocation inv)
focal_class.identifier: isAsync
focal_class.modifiers: public static
focal_class.parameters: (URL url, Invocation inv)
focal_class.return: boolean
focal_class.signature: boolean isAsync(URL url, Invocation inv)
focal_class.class_method_signature: RpcUtils.isReturnTypeFuture(Invocation inv)
focal_class.full_signature: public static boolean isReturnTypeFuture(Invocation inv)
focal_class.identifier: isReturnTypeFuture
focal_class.modifiers: public static
focal_class.parameters: (Invocation inv)
focal_class.return: boolean
focal_class.signature: boolean isReturnTypeFuture(Invocation inv)
focal_class.class_method_signature: RpcUtils.isGenericAsync(Invocation inv)
focal_class.full_signature: public static boolean isGenericAsync(Invocation inv)
focal_class.identifier: isGenericAsync
focal_class.modifiers: public static
focal_class.parameters: (Invocation inv)
focal_class.return: boolean
focal_class.signature: boolean isGenericAsync(Invocation inv)
focal_class.class_method_signature: RpcUtils.isGenericCall(String parameterTypesDesc, String method)
focal_class.full_signature: public static boolean isGenericCall(String parameterTypesDesc, String method)
focal_class.identifier: isGenericCall
focal_class.modifiers: public static
focal_class.parameters: (String parameterTypesDesc, String method)
focal_class.return: boolean
focal_class.signature: boolean isGenericCall(String parameterTypesDesc, String method)
focal_class.class_method_signature: RpcUtils.isEcho(String parameterTypesDesc, String method)
focal_class.full_signature: public static boolean isEcho(String parameterTypesDesc, String method)
focal_class.identifier: isEcho
focal_class.modifiers: public static
focal_class.parameters: (String parameterTypesDesc, String method)
focal_class.return: boolean
focal_class.signature: boolean isEcho(String parameterTypesDesc, String method)
focal_class.class_method_signature: RpcUtils.getInvokeMode(URL url, Invocation inv)
focal_class.full_signature: public static InvokeMode getInvokeMode(URL url, Invocation inv)
focal_class.identifier: getInvokeMode
focal_class.modifiers: public static
focal_class.parameters: (URL url, Invocation inv)
focal_class.return: InvokeMode
focal_class.signature: InvokeMode getInvokeMode(URL url, Invocation inv)
focal_class.class_method_signature: RpcUtils.isOneway(URL url, Invocation inv)
focal_class.full_signature: public static boolean isOneway(URL url, Invocation inv)
focal_class.identifier: isOneway
focal_class.modifiers: public static
focal_class.parameters: (URL url, Invocation inv)
focal_class.return: boolean
focal_class.signature: boolean isOneway(URL url, Invocation inv)
focal_class.class_method_signature: RpcUtils.getMethodByService(Invocation invocation, String service)
focal_class.full_signature: private static Method getMethodByService(Invocation invocation, String service)
focal_class.identifier: getMethodByService
focal_class.modifiers: private static
focal_class.parameters: (Invocation invocation, String service)
focal_class.return: Method
focal_class.signature: Method getMethodByService(Invocation invocation, String service)
focal_class.class_method_signature: RpcUtils.getTimeout(Invocation invocation, long defaultTimeout)
focal_class.full_signature: public static long getTimeout(Invocation invocation, long defaultTimeout)
focal_class.identifier: getTimeout
focal_class.modifiers: public static
focal_class.parameters: (Invocation invocation, long defaultTimeout)
focal_class.return: long
focal_class.signature: long getTimeout(Invocation invocation, long defaultTimeout)
focal_class.class_method_signature: RpcUtils.getTimeout(URL url, String methodName, RpcContext context, long defaultTimeout)
focal_class.full_signature: public static long getTimeout(URL url, String methodName, RpcContext context, long defaultTimeout)
focal_class.identifier: getTimeout
focal_class.modifiers: public static
focal_class.parameters: (URL url, String methodName, RpcContext context, long defaultTimeout)
focal_class.return: long
focal_class.signature: long getTimeout(URL url, String methodName, RpcContext context, long defaultTimeout)
focal_class.class_method_signature: RpcUtils.convertToNumber(Object obj, long defaultTimeout)
focal_class.full_signature: private static long convertToNumber(Object obj, long defaultTimeout)
focal_class.identifier: convertToNumber
focal_class.modifiers: private static
focal_class.parameters: (Object obj, long defaultTimeout)
focal_class.return: long
focal_class.signature: long convertToNumber(Object obj, long defaultTimeout)
focal_method.body: public static Class<?>[] getParameterTypes(Invocation invocation) {
          if ($INVOKE.equals(invocation.getMethodName())
                  && invocation.getArguments() != null
                  && invocation.getArguments().length > 1
                  && invocation.getArguments()[1] instanceof String[]) {
              String[] types = (String[]) invocation.getArguments()[1];
              if (types == null) {
                  return new Class<?>[0];
              }
              Class<?>[] parameterTypes = new Class<?>[types.length];
              for (int i = 0; i < types.length; i++) {
                  parameterTypes[i] = ReflectUtils.forName(types[0]);
              }
              return parameterTypes;
          }
          return invocation.getParameterTypes();
      }
focal_method.class_method_signature: RpcUtils.getParameterTypes(Invocation invocation)
focal_method.full_signature: public static Class<?>[] getParameterTypes(Invocation invocation)
focal_method.identifier: getParameterTypes
focal_method.invocations: equals getMethodName getArguments getArguments getArguments getArguments forName getParameterTypes
focal_method.modifiers: public static
focal_method.parameters: (Invocation invocation)
focal_method.return: Class<?>[]
focal_method.signature: Class<?>[] getParameterTypes(Invocation invocation)