List of usage examples for org.eclipse.jdt.internal.compiler.lookup MethodVerifier doesMethodOverride
public boolean doesMethodOverride(MethodBinding method, MethodBinding inheritedMethod)
From source file:com.redhat.ceylon.eclipse.core.model.mirror.JDTMethod.java
License:Open Source License
private boolean isDefinedInType(ReferenceBinding superClass, MethodBinding method) { MethodVerifier methodVerifier = superClass.getPackage().environment.methodVerifier(); for (MethodBinding inheritedMethod : superClass.methods()) { // skip ignored methods if (ignoreMethodInAncestorSearch(inheritedMethod)) { continue; }/*from w w w.j a v a 2s . c o m*/ if (methodVerifier.doesMethodOverride(method, inheritedMethod)) { return true; } } return false; }
From source file:com.redhat.ceylon.eclipse.core.model.mirror.JDTMethod.java
License:Open Source License
private boolean isOverloadingInType(ReferenceBinding superClass, MethodBinding method) { MethodVerifier methodVerifier = superClass.getPackage().environment.methodVerifier(); for (MethodBinding inheritedMethod : superClass.methods()) { if (inheritedMethod.isPrivate() || inheritedMethod.isStatic() || inheritedMethod.isConstructor() || inheritedMethod.isBridge() || inheritedMethod.isSynthetic() || !Arrays.equals(inheritedMethod.constantPoolName(), method.selector)) continue; // skip ignored methods if (ignoreMethodInAncestorSearch(inheritedMethod)) { continue; }/*w ww .j av a 2s .c o m*/ // if it does not override it and has the same name, it's overloading if (!methodVerifier.doesMethodOverride(method, inheritedMethod)) { return true; } } return false; }
From source file:org.eclipse.jdt.internal.compiler.lookup.Scope.java
License:Open Source License
private boolean isOverriddenMethodGeneric(MethodBinding method) { MethodVerifier verifier = environment().methodVerifier(); ReferenceBinding currentType = method.declaringClass.superclass(); while (currentType != null) { MethodBinding[] currentMethods = currentType.getMethods(method.selector); for (int i = 0, l = currentMethods.length; i < l; i++) { MethodBinding currentMethod = currentMethods[i]; if (currentMethod != null && currentMethod.original().typeVariables != Binding.NO_TYPE_VARIABLES) if (verifier.doesMethodOverride(method, currentMethod)) return true; }/*from w w w . ja v a 2 s .c om*/ currentType = currentType.superclass(); } return false; }