Checks whether this class or one of its superclasses or interfaces declares a method of the given name.

@param methodName
The name of a method.
@return true if this class or one of its superclasses or interfaces declares a method of the given name.
439017
public boolean hasMethod(final String methodName) {
        for (final ClassInfo ci : getOverrideOrder()) {
            if (ci.hasDeclaredMethod(methodName)) {
                return true;
            }
        }
        return false;
    }
1069919
private boolean methodExists(Class clazz, String name) {
        Method[] methods = clazz.getDeclaredMethods();
        for (int i = 0; i < methods.length; i++) {
            if (methods[i].getName().equals(name)) {
                return true;
            }
        }

        if (clazz.getSuperclass() != null
                && methodExists(clazz.getSuperclass(), name)) {
            return true;
        }

        Class[] interfaces = clazz.getInterfaces();
        for (int i = 0; i < interfaces.length; i++) {
            if (methodExists(interfaces[i], name)) {
                return true;
            }
        }

        return false;
    }
327426
public boolean isSuperClass(String otherClassName) {
      if (getClassWeAreModelling().getName().equals(otherClassName)) {
         return true;
      } else if (superClazz != null) {
         return superClazz.isSuperClass(otherClassName);
      } else {
         return false;
      }
   }
975409
def is_method_call(node, method_name):
    

    if not isinstance(node, nodes.Call):
        return False

    if isinstance(node.node, nodes.Getattr):
        # e.g. foo.bar()
        method = node.node.attr

    elif isinstance(node.node, nodes.Name):
        # e.g. bar()
        method = node.node.name

    elif isinstance(node.node, nodes.Getitem):
        # e.g. foo["bar"]()
        method = node.node.arg.value

    else:
        return False

    if isinstance(method_name, (list, tuple)):
        return method in method_name

    return method == method_name
1231190
public String getFullyQualifiedNameForMethodName(String methodName) {
    if (!methodNameToFullyQualifiedName.containsKey(methodName)) {
      return methodName;
    }

    return methodNameToFullyQualifiedName.get(methodName);
  }
1165941
private static boolean isDesignerMethod(Method method) {
        Class<?>[] parameterTypes = method.getParameterTypes();

        for (Class<?> parameterType : parameterTypes) {
            if (parameterType.isAssignableFrom(TestDesigner.class)) {
                return true;
            }
        }

        return false;
    }
607087
public static boolean isMethodOverridden(Method m, LinkedList<Class<?>> supers)
    {
        // Only check non-private methods for an override.
        int methodModifier = m.getModifiers();
        if (!Modifier.isPrivate(methodModifier))
        {
            // Not a private method, so we need to check if it is overridden.
            int startIndex = supers.indexOf(m.getDeclaringClass()) + 1;
            if (startIndex < supers.size())
            {
                String name = m.getName();
                Class<?>[] pTypes = m.getParameterTypes();
                for (ListIterator<Class<?>> lit = supers.listIterator(startIndex); lit.hasNext();)
                {
                    Class<?> subClass = lit.next();
                    try
                    {
                        subClass.getDeclaredMethod(name, pTypes);
                        return true;
                    } catch (NoSuchMethodException e)
                    {
                        //FFDCFilter.processException( e, "", "", m);
                        // This is normal, it just means the method was not overridden
                        // by a method in the current subclass being processed.
                    }
                }
            }
        }

        // The method is not overridden either because it is a private method,
        // or there is no subclass that overrides the method.
        return false;
    }
699335
private static boolean isRiskyName(String className, String methodName) {
		if (riskyClassNames.contains(className)) {
			return true;
		}

		String qualifiedMethodName = className + '.' + methodName;
		if (riskyMethodNameContents.contains(qualifiedMethodName)) {
			return true;
		}

		for (String riskyName : riskyMethodNameContents) {
			if (methodName.indexOf(riskyName) >= 0) {
				return true;
			}
		}

		return methodName.indexOf(Values.SYNTHETIC_MEMBER_CHAR) >= 0;
	}
917318
public function hasMethod($className, $methodName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        return isset($this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName]);
    }
571845
public function isMethodProtected($className, $methodName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        return (isset($this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_VISIBILITY]) && $this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_VISIBILITY] === self::VISIBILITY_PROTECTED);
    }
397693
public MethodInfo getMethodInfo(final String methodName) {
        for(MethodInfo item : methodInfos) {
            if(item.getMethodName().equals(methodName)) {
                return item;
            }
        }
        
        return null;
    }
479087
public static boolean methodEquals( Method method, Method other){
	    
		if ((method.getDeclaringClass().equals( other.getDeclaringClass()))
	    && (method.getName().equals( other.getName()))) {
	        if (!method.getReturnType().equals(other.getReturnType()))
	            return false;
	        
	        Class<?>[] params1 = method.getParameterTypes();
	        Class<?>[] params2 = other.getParameterTypes();
	        if (params1.length == params2.length) {
	            for (int i = 0; i < params1.length; i++) {
	            if (params1[i] != params2[i])
	                return false;
	            }
	            return true;
	        }
	    }
	    return false;
	}
823081
static <J> MethodId<J> MethodId(String name) {
		for (Method m : JavacTreeMaker.class.getDeclaredMethods()) {
			if (m.getName().equals(name)) {
				@SuppressWarnings("unchecked") Class<J> r = (Class<J>) m.getReturnType();
				Class<?>[] p = m.getParameterTypes();
				return new MethodId<J>(TreeMaker.class, name, r, p);
			}
		}
		
		throw new InternalError("Not found: " + name);
	}
1182856
static boolean isJavaPropertyMethod(final String methodName) {
        return (methodName.length() > PROPERTY_METHOD_PREFIX_LEN
                && (methodName.startsWith("get") || methodName.startsWith(("set"))));
    }
181491
public function hasMethod($methodName)
    {
        $methodNameLower = strtolower($methodName);
        foreach ($this->methods as $name => $method) {
            if ($methodNameLower == $name) {
                return true;
            }
        }

        $extendsClassDefinition = $this->getExtendsClassDefinition();
        if ($extendsClassDefinition instanceof ClassDefinitionRuntime) {
            try {
                $extendsClassDefinition = $this->compiler->getInternalClassDefinition(
                    $extendsClassDefinition->getName()
                );
            } catch (\ReflectionException $e) {
                // Do nothing
                return false;
            }
        }

        while ($extendsClassDefinition instanceof self) {
            if ($extendsClassDefinition->hasMethod($methodName)) {
                return true;
            }

            $extendsClassDefinition = $extendsClassDefinition->getExtendsClassDefinition();
        }

        return false;
    }
640766
public static boolean isObjectMethod(Method method) {
		if (method == null) {
			return false;
		}
		try {
			Object.class.getDeclaredMethod(method.getName(), method.getParameterTypes());
			return true;
		}
		catch (Exception ex) {
			return false;
		}
	}
800350
public function hasMethod( $methodName, $callableOnly = TRUE )
	{
		if( $callableOnly )
			return method_exists( $this, $methodName ) && is_callable( array( $this, $methodName ) );
		else
			return method_exists( $this, $methodName );
	}