Changes the access level for the specified method for a class.

@param clazz the clazz
@param methodName the method name
@param srgName the srg name
@param params the params
@return the method
348037
public static Method changeMethodAccess(Class<?> clazz, String methodName, String srgName, String params)
	{
		return changeMethodAccess(clazz, methodName, srgName, false, new MethodDescriptor(params).getParams());
	}
873447
public JMethod getMethod(String name, JClass []param)
  {
    return getRawClass().getMethod(name, param);
  }
920521
public static Object invokeStaticMethod(final Class<?> clazz, final String methodName, final Class<?>[] parameterTypes, final Object[] parameterValues) {
		Method method = getStaticMethod(clazz, methodName, parameterTypes);
		if (method == null) {
			throw new IllegalArgumentException("Could not find method [" + methodName + "] on target [" + clazz + "]");
		}
		try {
			return method.invoke(clazz, parameterValues);
		} catch (Exception e) {
			throw convertReflectionExceptionToUnchecked(e);
		}
	}
657539
Symbol accessMethod(Symbol sym,
                  DiagnosticPosition pos,
                  Type site,
                  Name name,
                  boolean qualified,
                  List<Type> argtypes,
                  List<Type> typeargtypes) {
        return accessMethod(sym, pos, site.tsym, site, name, qualified, argtypes, typeargtypes);
    }
727061
@SuppressWarnings("unchecked")
    public static <T> T execMethod(Method method, Object target, Object... params) {
        allowAccess(method);
        try {
            return (T) method.invoke(target, params);
        } catch (Throwable e) {
            throw new ReflectException(e);
        }
    }
753042
@Override
  public MethodVisitor visitMethod(int access,
                                   String name,
                                   String description,
                                   String signature,
                                   String[] exceptions) {
    methods.add(new MethodInfo(access,
        name,
        description,
        signature,
        exceptions));
    return null;
  }
243503
private void loadProtoClassToCache(String key, Class clazz, String methodName) {
        Method pbMethod = null;
        Method[] methods = clazz.getMethods();
        for (Method method : methods) {
            if (methodName.equals(method.getName())) {
                pbMethod = method;
                break;
            }
        }
        if (pbMethod == null) {
            throw new SofaRpcRuntimeException("Cannot found protobuf method: " + clazz.getName() + "." + methodName);
        }
        Class[] parameterTypes = pbMethod.getParameterTypes();
        if (parameterTypes == null
            || parameterTypes.length != 1
            || isProtoBufMessageObject(parameterTypes[0])) {
            throw new SofaRpcRuntimeException("class based protobuf: " + clazz.getName()
                + ", only support one protobuf parameter!");
        }
        Class reqClass = parameterTypes[0];
        requestClassCache.put(key, reqClass);
        Class resClass = pbMethod.getReturnType();
        if (resClass == void.class || !isProtoBufMessageClass(resClass)) {
            throw new SofaRpcRuntimeException("class based protobuf: " + clazz.getName()
                + ", only support return protobuf message!");
        }
        responseClassCache.put(key, resClass);
    }
812712
public static Method getMethod(String clazzName, String methodName, String[] argsType) {
        Class clazz = ClassUtils.forName(clazzName);
        Class[] classes = ClassTypeUtils.getClasses(argsType);
        return getMethod(clazz, methodName, classes);
    }
1230887
public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>[] argTypes) {
        assertObjectNotNull("clazz", clazz);
        assertStringNotNullAndNotTrimmedEmpty("methodName", methodName);
        return findMethod(clazz, methodName, argTypes, VisibilityType.PUBLIC, false);
    }
1279800
private static String getClassMethod(Class clazz, Method method) {
		StringBuilder builder = new StringBuilder();
		builder.append(clazz.getName()).append(".").append(method.getName());
		builder.append("(");
		if (method.getParameterCount() > 0) {
			for (int i = 0; i < method.getParameterCount(); i++) {
				Parameter param = method.getParameters()[i];
				builder.append(param.getType().getSimpleName()).append(" ").append(param.getName());

				if (i + 1 < method.getParameterCount()) {
					builder.append(", ");
				}
			}
		}
		builder.append(")");
		return builder.toString();
	}
1248186
protected Object chooseMethod(String methodName, Object methodOrList, Class[] arguments) {
        Object method = chooseMethodInternal(methodName, methodOrList, arguments);
        if (method instanceof GeneratedMetaMethod.Proxy)
            return ((GeneratedMetaMethod.Proxy)method).proxy ();
        return method;
    }
538278
public void blocker(String blockerClass, String param, String value) 
		throws ClassNotFoundException,InstantiationException,IllegalAccessException,
					 InvocationTargetException,NoSuchMethodException
	{
		Blocker blocker = (Blocker)Class.forName(BLOCKER_PACKAGE+blockerClass).newInstance();
		// upperCase the first letter of param
		param = param.substring(0,1).toUpperCase() + param.substring(1,param.length());
		Method m = blocker.getClass().getMethod("set"+param, new Class[] { Boolean.class });
		m.invoke( blocker, new Object[]{ Boolean.valueOf(value) } );
		blockers.add( blocker );
		blockerNames.add( blockerClass );
		expt = null;
	}
307008
public static Set<String> getMethodNames(Class<?> clazz) throws SecurityException {
		final HashSet<String> methodSet = new HashSet<String>();
		final Method[] methods = getMethods(clazz);
		for (Method method : methods) {
			methodSet.add(method.getName());
		}
		return methodSet;
	}
288403
@Override
    public MethodVisitor visitMethod(int access, String name, String desc, String signature, String exceptions[]) {
        // skip static initializers
        if (name.equals("<clinit>")) {
            return null;
        }

        MethodInfoImpl methodInfo = new MethodInfoImpl(name, desc, exceptions, access, classInfo);

        if (name.equals("<init>")) {
            constructorInfos.add(methodInfo);
        } else {
            methodInfos.add(methodInfo);
        }

        if (logParms != null) {
            logParms[1] = name;
            logParms[2] = methodInfo.getHashText();
        }

        methodVisitor.setMethodInfo(methodInfo);
        return methodVisitor;
    }
890415
private Method methodExists(Class<?> clazz, String method, Class<?>[] params) {
		try {
			return clazz.getMethod(method, params);
		} catch (NoSuchMethodException e) {
			return null;
		}
	}
1132930
public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) throws SecurityException {
		try {
			return clazz.getMethod(methodName, paramTypes);
		} catch (NoSuchMethodException ex) {
			return null;
		}
	}
735142
@Override
  public MethodVisitor visitMethod(
      final int access,
      final String name,
      final String desc,
      final String signature,
      final String[] exceptions) {
    MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
    return new CodeSizeEvaluator(mv) {
      @Override
      public void visitEnd() {
        super.visitEnd();
        if (getMaxSize() > 64 * 1024) {
          state = State.FAIL_TOO_LONG;
          message = "the method " + name + " was too long.";
        }
      }
    };
  }