/** * Returns whether the code gen will use an invoke virtual for * this message send or not. */ protected boolean isVirtualInvoke(MethodBinding method, MessageSend messageSend) { return !method.isStatic() && !method.isPrivate() && !messageSend.isSuperAccess() && !(method.isDefault() && this.pattern.focus != null && !CharOperation.equals(this.pattern.declaringPackageName, method.declaringClass.qualifiedPackageName())); } public int match(ASTNode node, MatchingNodeSet nodeSet) {
/** * Returns whether the code gen will use an invoke virtual for * this message send or not. */ protected boolean isVirtualInvoke(MethodBinding method, MessageSend messageSend) { return !method.isStatic() && !method.isPrivate() && !messageSend.isSuperAccess() && !(method.isDefault() && this.pattern.focus != null && !CharOperation.equals(this.pattern.declaringPackageName, method.declaringClass.qualifiedPackageName())); } protected ReferenceBinding checkMethodRef(MethodBinding method, ReferenceExpression referenceExpression) {
/** * Returns whether the code gen will use an invoke virtual for * this message send or not. */ protected boolean isVirtualInvoke(MethodBinding method, MessageSend messageSend) { return !method.isStatic() && !method.isPrivate() && !messageSend.isSuperAccess() && !(method.isDefault() && this.pattern.focus != null && !CharOperation.equals(this.pattern.declaringPackageName, method.declaringClass.qualifiedPackageName())); } protected ReferenceBinding checkMethodRef(MethodBinding method, ReferenceExpression referenceExpression) {
/** * Returns whether the code gen will use an invoke virtual for * this message send or not. */ protected boolean isVirtualInvoke(MethodBinding method, MessageSend messageSend) { return !method.isStatic() && !method.isPrivate() && !messageSend.isSuperAccess() && !(method.isDefault() && this.pattern.focus != null && !CharOperation.equals(this.pattern.declaringPackageName, method.declaringClass.qualifiedPackageName())); } protected ReferenceBinding checkMethodRef(MethodBinding method, ReferenceExpression referenceExpression) {
/** * Returns whether the code gen will use an invoke virtual for * this message send or not. */ protected boolean isVirtualInvoke(MethodBinding method, MessageSend messageSend) { return !method.isStatic() && !method.isPrivate() && !messageSend.isSuperAccess() && !(method.isDefault() && this.pattern.focus != null && !CharOperation.equals(this.pattern.declaringPackageName, method.declaringClass.qualifiedPackageName())); } public int match(ASTNode node, MatchingNodeSet nodeSet) {
protected ReferenceBinding checkMethodRef(MethodBinding method, ReferenceExpression referenceExpression) { boolean result = (!method.isStatic() && !method.isPrivate() && referenceExpression.isMethodReference() && !(method.isDefault() && this.pattern.focus != null && !CharOperation.equals(this.pattern.declaringPackageName, method.declaringClass.qualifiedPackageName()))); if (result) { Expression lhs = referenceExpression.lhs; if (lhs instanceof NameReference) { Binding binding = ((NameReference) lhs).binding; if (binding instanceof ReferenceBinding) return (ReferenceBinding) binding; } } return null; } public int match(ASTNode node, MatchingNodeSet nodeSet) {
protected ReferenceBinding checkMethodRef(MethodBinding method, ReferenceExpression referenceExpression) { boolean result = (!method.isStatic() && !method.isPrivate() && referenceExpression.isMethodReference() && !(method.isDefault() && this.pattern.focus != null && !CharOperation.equals(this.pattern.declaringPackageName, method.declaringClass.qualifiedPackageName()))); if (result) { Expression lhs = referenceExpression.lhs; if (lhs instanceof NameReference) { Binding binding = ((NameReference) lhs).binding; if (binding instanceof ReferenceBinding) return (ReferenceBinding) binding; } } return null; } @Override
protected ReferenceBinding checkMethodRef(MethodBinding method, ReferenceExpression referenceExpression) { boolean result = (!method.isStatic() && !method.isPrivate() && referenceExpression.isMethodReference() && !(method.isDefault() && this.pattern.focus != null && !CharOperation.equals(this.pattern.declaringPackageName, method.declaringClass.qualifiedPackageName()))); if (result) { Expression lhs = referenceExpression.lhs; if (lhs instanceof NameReference) { Binding binding = ((NameReference) lhs).binding; if (binding instanceof ReferenceBinding) return (ReferenceBinding) binding; } } return null; } public int match(ASTNode node, MatchingNodeSet nodeSet) {
void checkConcreteInheritedMethod(MethodBinding concreteMethod, MethodBinding[] abstractMethods) { // Remember that interfaces can only define public instance methods if (concreteMethod.isStatic()) // Cannot inherit a static method which is specified as an instance method by an interface problemReporter().staticInheritedMethodConflicts(this.type, concreteMethod, abstractMethods); if (!concreteMethod.isPublic()) { int index = 0, length = abstractMethods.length; if (concreteMethod.isProtected()) { for (; index < length; index++) if (abstractMethods[index].isPublic()) break; } else if (concreteMethod.isDefault()) { for (; index < length; index++) if (!abstractMethods[index].isDefault()) break; } if (index < length) problemReporter().inheritedMethodReducesVisibility(this.type, concreteMethod, abstractMethods); } if (concreteMethod.thrownExceptions != Binding.NO_EXCEPTIONS) for (int i = abstractMethods.length; --i >= 0;) checkExceptions(concreteMethod, abstractMethods[i]); // A subclass inheriting this method and putting it up as the implementation to meet its own // obligations should qualify as a use. if (concreteMethod.isOrEnclosedByPrivateType()) concreteMethod.original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed; }
boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }
static boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }
static boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }
static boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }
static boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }
static boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }
static boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }
boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }
boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }
static boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }
static boolean couldMethodOverride(MethodBinding method, MethodBinding inheritedMethod) { if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector)) return false; if (method == inheritedMethod || method.isStatic() || inheritedMethod.isStatic()) return false; if (inheritedMethod.isPrivate()) return false; if (inheritedMethod.isDefault() && method.declaringClass.getPackage() != inheritedMethod.declaringClass.getPackage()) return false; if (!method.isPublic()) { // inheritedMethod is either public or protected & method is less than public if (inheritedMethod.isPublic()) return false; if (inheritedMethod.isProtected() && !method.isProtected()) return false; } return true; }