/** @see IMethodBinding#overrides(IMethodBinding) */ public boolean overrides(IMethodBinding otherMethod) { LookupEnvironment lookupEnvironment = this.resolver.lookupEnvironment(); return lookupEnvironment != null && lookupEnvironment .methodVerifier() .doesMethodOverride(this.binding, ((MethodBinding) otherMethod).binding); }
public boolean isSubsignature(IMethodBinding otherMethod) { try { LookupEnvironment lookupEnvironment = this.resolver.lookupEnvironment(); return lookupEnvironment != null && lookupEnvironment .methodVerifier() .isMethodSubsignature(this.binding, ((MethodBinding) otherMethod).binding); } catch (AbortCompilation e) { // don't surface internal exception to clients // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=143013 return false; } }
/* (non-Javadoc) * @see IMethodBinding#overrides(IMethodBinding) */ public boolean overrides(IMethodBinding overridenMethod) { org.eclipse.jdt.internal.compiler.lookup.MethodBinding overridenCompilerBinding = ((MethodBinding) overridenMethod).binding; if (this.binding == overridenCompilerBinding) return false; if (!CharOperation.equals(this.binding.selector, overridenCompilerBinding.selector)) return false; ReferenceBinding match = this.binding.declaringClass.findSuperTypeWithSameErasure( overridenCompilerBinding.declaringClass); if (match == null) return false; org.eclipse.jdt.internal.compiler.lookup.MethodBinding[] superMethods = match.methods(); for (int i = 0, length = superMethods.length; i < length; i++) { if (superMethods[i].original() == overridenCompilerBinding) { LookupEnvironment lookupEnvironment = this.resolver.lookupEnvironment(); if (lookupEnvironment == null) return false; MethodVerifier methodVerifier = lookupEnvironment.methodVerifier(); return methodVerifier.doesMethodOverride(this.binding, superMethods[i]); } } return false; }