Two function types are equal if their signatures match. Since they don't have signatures, two
interfaces are equal if their names match.
16122
final boolean checkFunctionEquivalenceHelper(
      FunctionType that, EquivalenceMethod eqMethod, EqCache eqCache) {
    if (this == that) {
      return true;
    }
    if (kind != that.kind) {
      return false;
    }
    switch (kind) {
      case CONSTRUCTOR:
        return false; // constructors use identity semantics, which we already checked for above.
      case INTERFACE:
        return getReferenceName().equals(that.getReferenceName());
      case ORDINARY:
        return typeOfThis.checkEquivalenceHelper(that.typeOfThis, eqMethod, eqCache)
            && call.checkArrowEquivalenceHelper(that.call, eqMethod, eqCache);
      default:
        throw new AssertionError();
    }
  }
816046
private boolean equalsSimpleTypeNames(MethodIdentifier identifier, MethodResult methodResult) {
        MethodIdentifier originalIdentifier = methodResult.getOriginalMethodSignature();

        return originalIdentifier.getMethodName().equals(identifier.getMethodName()) &&
                matchesTypeBestEffort(originalIdentifier.getReturnType(), identifier.getReturnType()) &&
                parameterMatch(originalIdentifier.getParameters(), identifier.getParameters());
    }
1313282
private boolean isSimilarSignature(Method possiblyMatchingMethod, String desiredMethodName, Class<?>[] desiredParamTypes) {
        return possiblyMatchingMethod.getName().equals(desiredMethodName) && match(possiblyMatchingMethod.getParameterTypes(), desiredParamTypes);
    }
253403
function _compareTypes(typeA, typeB, sameTypes, propertyA, propertyB) {
  sameTypes = sameTypes || {}
  if (typeA === typeB) {
    if (typeA === types.class && propertyA && propertyB) {
      return propertyA.constructor.name === propertyB.constructor.name;
    }
    return true;
  }

  if (Object.keys(sameTypes).length === 0) {
    return false;
  }
  let typeKeyA;
  let typeKeyB;
  let foundMatch = false
  Object.keys(sameTypes).forEach((key) => {
    if (foundMatch) { return }
    const similar = sameTypes[key];
    if (similar.indexOf(typeA) > -1) {
      typeKeyA = key;
    }
    if (similar.indexOf(typeB) > -1) {
      typeKeyB = key;
    }
    if (typeKeyA && typeKeyB) { foundMatch = true }
  });
  return foundMatch && typeKeyA === typeKeyB;
}
44559
function _is_same(a, b){
	//bark('typeof(a, b): ' + typeof(a) + ',' + typeof(b));

	var ret = false;
	if( a == b ){ // atoms, incl. null and 'string'
	    //bark('true on equal atoms: ' + a + '<>' + b);
	    ret = true;
	}else{ // is list or obj (ignore func)
	    if( typeof(a) === 'object' && typeof(b) === 'object' ){
		//bark('...are objects');
		
		// Null is an object, but not like the others.
		if( a == null || b == null ){
		    ret = false;
		}else if( Array.isArray(a) && Array.isArray(b) ){ // array equiv
		    //bark('...are arrays');
		    
		    // Recursively check array equiv.
		    if( a.length == b.length ){
			if( a.length == 0 ){
			    //bark('true on 0 length array');
			    ret = true;
			}else{
			    ret = true; // assume true until false here
			    for( var i = 0; i < a.length; i++ ){
				if( ! _is_same(a[i], b[i]) ){
				    //bark('false on diff @ index: ' + i);
				    ret = false;
				    break;
				}
			    }
			}
		    }

		}else{ // object equiv.

		    // Get unique set of keys.
		    var a_keys = Object.keys(a);
		    var b_keys = Object.keys(b);
		    var keys = a_keys.concat(b_keys.filter(function(it){
			return a_keys.indexOf(it) < 0;
		    }));
		    
		    // Assume true until false.
		    ret = true;
		    for( var j = 0; j < keys.length; j++ ){ // no forEach - break
			var k = keys[j];
			if( ! _is_same(a[k], b[k]) ){
			    //bark('false on key: ' + k);
			    ret = false;
			    break;
			}
		    }
		}
	    }else{
		//bark('false by default');
	    }
	}
	
	return ret;
    }
503186
def makeEqualFunction(self, originalEqualFunction, syntheticMemberList):
        
        def equal(instance, other):
            if instance.__class__ is not other.__class__:
                return NotImplemented

            for m in syntheticMemberList:
                if getattr(instance, m.privateMemberName()) != getattr(other, m.privateMemberName()):
                    return False

            if inspect.isfunction(originalEqualFunction) or inspect.ismethod(originalEqualFunction):
                return originalEqualFunction(instance, other)

            return True

        return equal
730324
private static boolean areMethodNameAndParameterTypesEqual(Method methodA, Method methodB) {
        if (!methodA.getName().equals(methodB.getName())) {
            return false;
        }
        Class<?>[] methodAParameterTypes = methodA.getParameterTypes();
        Class<?>[] methodBParameterTypes = methodB.getParameterTypes();
        if (methodAParameterTypes.length != methodBParameterTypes.length) {
            return false;
        }
        for (int i = 0; i < methodAParameterTypes.length; i++) {
            if (!methodAParameterTypes[i].equals(methodBParameterTypes[i])) {
                return false;
            }
        }

        return true;
    }
462355
function innerEquiv( a, b ) {

		// We're done when there's nothing more to compare
		if ( arguments.length < 2 ) {
			return true;
		}

		// Require type-specific equality
		return ( a === b || typeEquiv( a, b ) ) &&

			// ...across all consecutive argument pairs
			( arguments.length === 2 || innerEquiv.apply( this, [].slice.call( arguments, 1 ) ) );
	}
454885
function equals( obj1, obj2 ){
	var t1 = typeof obj1,
		t2 = typeof obj2,
		c,
		i,
		keyCheck;

	if ( obj1 === obj2 ){
		return true;
	}else if ( obj1 !== obj1 && obj2 !== obj2 ){
		return true; // silly NaN
	}else if ( obj1 === null || obj1 === undefined || obj2 === null || obj2 === undefined ){
		return false; // undefined or null
	}else if ( obj1.equals ){
		return obj1.equals( obj2 );
	}else if ( obj2.equals ){
		return obj2.equals( obj1 ); // because maybe somene wants a class to be able to equal a simple object
	}else if ( t1 === t2 ){
		if ( t1 === 'object' ){
			if ( bmoor.isArrayLike(obj1) ){
				if ( !bmoor.isArrayLike(obj2) ){ 
					return false; 
				}

				if ( (c = obj1.length) === obj2.length ){
					for( i = 0; i < c; i++ ){
						if ( !equals(obj1[i], obj2[i]) ) { 
							return false;
						}
					}

					return true;
				}
			}else if ( !bmoor.isArrayLike(obj2) ){
				keyCheck = {};
				for( i in obj1 ){
					if ( obj1.hasOwnProperty(i) ){
						if ( !equals(obj1[i],obj2[i]) ){
							return false;
						}

						keyCheck[i] = true;
					}
				}

				for( i in obj2 ){
					if ( obj2.hasOwnProperty(i) ){
						if ( !keyCheck && obj2[i] !== undefined ){
							return false;
						}
					}
				}
			}
		}
	}

	return false;
}
963091
public static boolean isSameType(@Nonnull TypeMirror t1, @Nonnull TypeMirror t2) {
        String t1Name = toUniqueString(t1);
        String t2Name = toUniqueString(t2);

        return t1Name.equals(t2Name);
    }
1247374
private static boolean isMatching(Method base, Method compare) {

		// if names and argument types match ... then this are the same method
		if (base.getName().equals(compare.getName()) &&
		    base.getParameterCount() == compare.getParameterCount()) {

			Class<?>[] typeBase = base.getParameterTypes();
			Class<?>[] typeCompare = compare.getParameterTypes();

			for (int index = 0; index < typeBase.length; index++) {
				Class clazzBase = typeBase[index];
				Class clazzCompare = typeCompare[index];
				if (!clazzBase.equals(clazzCompare)) {
					return false;
				}
			}

			return true;
		}

		return false;
	}
965864
private boolean primitiveEquals(
        Object switchVal, Object targetVal,
        CallStack callstack, SimpleNode switchExp  )
        throws EvalError
    {
        if (targetVal == Primitive.VOID)
            return false;
        if ( switchVal instanceof Primitive || targetVal instanceof Primitive )
            try {
                // binaryOperation can return Primitive or wrapper type
                Object result = Operators.binaryOperation(
                    switchVal, targetVal, ParserConstants.EQ );
                result = Primitive.unwrap( result );
                return result.equals( Boolean.TRUE );
            } catch ( UtilEvalError e ) {
                throw e.toEvalError(
                    "Switch value: "+switchExp.getText()+": ",
                    this, callstack );
            }
        else
            return switchVal.equals( targetVal );
    }
1070626
private static boolean propertyEquals(Property a, Property b) {
        return (a.getName().equals(b.getName())) && (a.getValue().asString().equals(b.getValue().asString()));
    }
436913
public static boolean nameEquals(char[][] typeName, String string) {
		int pos = 0, len = string.length();
		for (int i = 0; i < typeName.length; i++) {
			char[] t = typeName[i];
			if (i > 0) {
				if (pos == len) return false;
				if (string.charAt(pos++) != '.') return false;
			}
			for (int j = 0; j < t.length; j++) {
				if (pos == len) return false;
				if (string.charAt(pos++) != t[j]) return false;
			}
		}
		
		return true;
	}
939542
public static boolean methodInsnEqual(MethodInsnNode insn1, MethodInsnNode insn2)
	{
		return insn1.owner.equals(insn2.owner) && insn1.name.equals(insn2.name) && insn1.desc.equals(insn2.desc);
	}
396678
def is_signature_equal(cls, sig_a, sig_b):
        """"""
        if len(sig_a) != len(sig_b):
            return False

        invalid_chars = 0
        for char_a, char_b in zip(sig_a, sig_b):
            if char_a != char_b:
                invalid_chars += 1
        return invalid_chars == 0
1147267
def differing_functions_with_consts(self):
        
        different_funcs = []
        for (func_a, func_b) in self.function_matches:
            if not self.functions_probably_identical(func_a, func_b, check_consts=True):
                different_funcs.append((func_a, func_b))
        return different_funcs