Getting all Benchmarkable methods out of the registered class.

@return a Set with {@link BenchmarkMethod}
@throws PerfidixMethodCheckException
550780
List<BenchmarkMethod> getBenchmarkMethods()
			throws PerfidixMethodCheckException {
		// Generating Set for returnVal
		final List<BenchmarkMethod> elems = new ArrayList<BenchmarkMethod>();
		// Getting all Methods and testing if its benchmarkable
		for (final Class<?> clazz : clazzes) {
			for (final Method meth : clazz.getDeclaredMethods()) {
				// Check if benchmarkable, if so, insert to returnVal;
				if (BenchmarkMethod.isBenchmarkable(meth)) {
					final BenchmarkMethod benchmarkMeth = new BenchmarkMethod(
							meth);
					elems.add(benchmarkMeth);
				}
			}
		}
		return elems;
	}
1026497
public static <T extends Annotation> Set<Method> getAnnotatedPublicMethods(Class<?> clazz, Class<T> annotation) {
		// 已递归到Objebt.class, 停止递归
		if (Object.class.equals(clazz)) {
			return Collections.emptySet();
		}

		List<Class<?>> ifcs = ClassUtils.getAllInterfaces(clazz);
		Set<Method> annotatedMethods = new HashSet<Method>();

		// 遍历当前类的所有公共方法
		Method[] methods = clazz.getMethods();

		for (Method method : methods) {
			// 如果当前方法有标注，或定义了该方法的所有接口有标注
			if (method.getAnnotation(annotation) != null || searchOnInterfaces(method, annotation, ifcs)) {
				annotatedMethods.add(method);
			}
		}

		return annotatedMethods;
	}
993519
public List getMethods()
    {
        if (_umMethods == null && _methods != null)
            _umMethods= Collections.unmodifiableList(LazyList.getList(_methods));
        return _umMethods;
    }
115348
private static Method[] getDeclaredMethods(Class<?> clazz) {
		Method[] result = declaredMethodsCache.get(clazz);
		if (result == null) {
			result = clazz.getDeclaredMethods();
			declaredMethodsCache.put(clazz, result);
		}
		return result;
	}
408352
private static Set<Method> findLockedMethods(ClassContext classContext, SelfCalls selfCalls, Set<CallSite> obviouslyLockedSites)
    {

        JavaClass javaClass = classContext.getJavaClass();
        Method[] methodList = javaClass.getMethods();

        CallGraph callGraph = selfCalls.getCallGraph();

        // Initially, assume all methods are locked
        Set<Method> lockedMethodSet = new HashSet<>();

        // Assume all public methods are unlocked
        for (Method method : methodList) {
            if (method.isSynchronized()) {
                lockedMethodSet.add(method);
            }
        }

        // Explore the self-call graph to find nonpublic methods
        // that can be called from an unlocked context.
        boolean change;
        do {
            change = false;

            for (Iterator<CallGraphEdge> i = callGraph.edgeIterator(); i.hasNext();) {
                CallGraphEdge edge = i.next();
                CallSite callSite = edge.getCallSite();

                if (obviouslyLockedSites.contains(callSite) || lockedMethodSet.contains(callSite.getMethod())) {
                    // Calling method is locked, so the called method
                    // is also locked.
                    CallGraphNode target = edge.getTarget();
                    if (lockedMethodSet.add(target.getMethod())) {
                        change = true;
                    }
                }
            }
        } while (change);

        if (DEBUG) {
            System.out.println("Apparently locked methods:");
            for (Method method : lockedMethodSet) {
                System.out.println("\t" + method.getName());
            }
        }

        // We assume that any methods left in the locked set
        // are called only from a locked context.
        return lockedMethodSet;
    }
1135447
@Benchmark
    public Class<?> benchmarkJavassist() {
        ProxyFactory proxyFactory = new ProxyFactory() {
            protected ClassLoader getClassLoader() {
                return newClassLoader();
            }
        };
        proxyFactory.setUseCache(false);
        proxyFactory.setUseWriteReplace(false);
        proxyFactory.setSuperclass(baseClass);
        proxyFactory.setFilter(new MethodFilter() {
            public boolean isHandled(Method method) {
                return false;
            }
        });
        return proxyFactory.createClass();
    }
523938
@Benchmark
    public ExampleInterface benchmarkJavassist() throws Exception {
        ProxyFactory proxyFactory = new ProxyFactory() {
            protected ClassLoader getClassLoader() {
                return newClassLoader();
            }
        };
        proxyFactory.setUseCache(false);
        proxyFactory.setUseWriteReplace(false);
        proxyFactory.setSuperclass(Object.class);
        proxyFactory.setInterfaces(new Class<?>[]{baseClass});
        proxyFactory.setFilter(new MethodFilter() {
            public boolean isHandled(Method method) {
                return true;
            }
        });
        @SuppressWarnings("unchecked")
        Object instance = proxyFactory.createClass().getDeclaredConstructor().newInstance();
        ((javassist.util.proxy.Proxy) instance).setHandler(new MethodHandler() {
            public Object invoke(Object self,
                                 Method thisMethod,
                                 Method proceed,
                                 Object[] args) throws Throwable {
                Class<?> returnType = thisMethod.getReturnType();
                if (returnType.isPrimitive()) {
                    if (returnType == boolean.class) {
                        return defaultBooleanValue;
                    } else if (returnType == byte.class) {
                        return defaultByteValue;
                    } else if (returnType == short.class) {
                        return defaultShortValue;
                    } else if (returnType == char.class) {
                        return defaultCharValue;
                    } else if (returnType == int.class) {
                        return defaultIntValue;
                    } else if (returnType == long.class) {
                        return defaultLongValue;
                    } else if (returnType == float.class) {
                        return defaultFloatValue;
                    } else {
                        return defaultDoubleValue;
                    }
                } else {
                    return defaultReferenceValue;
                }
            }
        });
        return (ExampleInterface) instance;
    }
788848
public function getClassMethods()
    {
        if (empty($this->_methods)) {
            $methods = $this->_getReflection()->getMethods();
            foreach ($methods as $method) {
                $this->_methods[] = $method->getName();
            }
        }
        return $this->_methods;
    }
282406
public function getAll()
    {
        $benchmarks = array();

        @reset($this->results);
        while (list($identifier, $elapsed_time) = @each($this->results)) {
            if (!isset($this->temporary[$identifier])) {
                $benchmarks[$identifier] = $elapsed_time;
            }
        }

        return $benchmarks;
    }
535765
def get_methods(self):
        
        if self.__cache_all_methods is None:
            self.__cache_all_methods = []
            for i in self.get_classes():
                for j in i.get_methods():
                    self.__cache_all_methods.append(j)
        return self.__cache_all_methods
300211
public static Method[] getAllMethods(Class<?> clz) {
    Set<Method> set = new HashSet<>();
    List<Class<?>> classes = new ArrayList<>();
    classes.add(clz);
    classes.addAll(Arrays.asList(getAllSuperClasses(clz)));
    classes.addAll(Arrays.asList(getAllInterfaces(clz)));
    for (Class<?> c : classes) {
      set.addAll(Arrays.asList(c.getDeclaredMethods()));
    }
    return set.toArray(new Method[set.size()]);
  }
22434
public SortedSet<TypeElement> allUnnamedClasses() {
        for (PackageElement pkg : allClasses.keySet()) {
            if (pkg.isUnnamed()) {
                return allClasses.get(pkg);
            }
        }
        return new TreeSet<>(comparator);
    }
413182
public MethodInfo[] getMethods() {
        int size = mMethods.size();
        List<MethodInfo> methodsOnly = new ArrayList<MethodInfo>(size);

        for (int i=0; i<size; i++) {
            MethodInfo method = mMethods.get(i);
            String name = method.getName();
            if (!"<init>".equals(name) && !"<clinit>".equals(name)) {
                methodsOnly.add(method);
            }
        }

        MethodInfo[] methodsArray = new MethodInfo[methodsOnly.size()];
        return methodsOnly.toArray(methodsArray);
    }
1182416
public synchronized Set<U> removeAll() {

        Set<U> result = new HashSet<U>(m_set);
        m_set.clear();
        return result;
    }
882484
public List<RemoveMethodType<SessionBeanType<T>>> getAllRemoveMethod()
   {
      List<RemoveMethodType<SessionBeanType<T>>> list = new ArrayList<RemoveMethodType<SessionBeanType<T>>>();
      List<Node> nodeList = childNode.get("remove-method");
      for(Node node: nodeList)
      {
         RemoveMethodType<SessionBeanType<T>>  type = new RemoveMethodTypeImpl<SessionBeanType<T>>(this, "remove-method", childNode, node);
         list.add(type);
      }
      return list;
   }
1281515
public List<MetaMethod> getMethods() {
        List<MetaMethod> methodList = new ArrayList<MetaMethod>();
        methodList.addAll(this.expandoMethods.values());
        methodList.addAll(super.getMethods());
        return methodList;
    }
579844
public static Set<Method> getAllMethodsInHierarchy(Method method) {
        LinkedHashSet<Method> allMethods = new LinkedHashSet<>();
        val declaringClass = method.getDeclaringClass();
        return getAllMethodsInHierarchy(allMethods, declaringClass, method);
    }