closestMatchOriginal.modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
}
}
return this.resolvedType;
}
final CompilerOptions compilerOptions = scope.compilerOptions();
if (!this.binding.isStatic()) {
// the "receiver" must not be a type, in other words, a NameReference that the TC has bound to a Type
if (receiverIsType) {
scope.problemReporter().mustUseAStaticMethod(this, this.binding);
if (this.actualReceiverType.isRawType()
&& (this.receiver.bits & ASTNode.IgnoreRawTypeCheck) == 0
&& compilerOptions.getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore) {
scope.problemReporter().rawTypeReference(this.receiver, this.actualReceiverType);
}
} else {
this.receiver.computeConversion(scope, this.actualReceiverType, this.actualReceiverType);
// compute generic cast if necessary
TypeBinding receiverErasure = this.actualReceiverType.erasure();
if (receiverErasure instanceof ReferenceBinding) {
if (receiverErasure.findSuperTypeWithSameErasure(this.binding.declaringClass) == null) {
this.receiverGenericCast = this.binding.declaringClass; // handle indirect inheritance thru variable secondary bound
}
}
}
} else {
// static message invoked through receiver? legal but unoptimal (optional warning).
if (!(this.receiver.isImplicitThis() || this.receiver.isSuper() || receiverIsType)) {
scope.problemReporter().nonStaticAccessToStaticMethod(this, this.binding);
}
if (!this.receiver.isImplicitThis() && this.binding.declaringClass != this.actualReceiverType) {
scope.problemReporter().indirectAccessToStaticMethod(this, this.binding);
}
}
checkInvocationArguments(scope, this.receiver, this.actualReceiverType, this.binding, this.arguments, argumentTypes, argsContainCast, this);
//-------message send that are known to fail at compile time-----------
if (this.binding.isAbstract()) {
if (this.receiver.isSuper()) {
scope.problemReporter().cannotDireclyInvokeAbstractMethod(this, this.binding);
}
// abstract private methods cannot occur nor abstract static............
}
if (isMethodUseDeprecated(this.binding, scope, true))
scope.problemReporter().deprecatedMethod(this.binding, this);
// from 1.5 compliance on, array#clone() returns the array type (but binding still shows Object)
if (this.actualReceiverType.isArrayType()
&& this.binding.parameters == Binding.NO_PARAMETERS
&& compilerOptions.complianceLevel >= ClassFileConstants.JDK1_5
&& CharOperation.equals(this.binding.selector, TypeConstants.CLONE)) {
this.resolvedType = this.actualReceiverType;
} else {
TypeBinding returnType = this.binding.returnType;
if (returnType != null) returnType = returnType.capture(scope, this.sourceEnd);
this.resolvedType = returnType;
}
if (this.receiver.isSuper() && compilerOptions.getSeverity(CompilerOptions.OverridingMethodWithoutSuperInvocation) != ProblemSeverities.Ignore) {
final ReferenceContext referenceContext = scope.methodScope().referenceContext;
if (referenceContext instanceof AbstractMethodDeclaration) {
final AbstractMethodDeclaration abstractMethodDeclaration = (AbstractMethodDeclaration) referenceContext;
MethodBinding enclosingMethodBinding = abstractMethodDeclaration.binding;
if (enclosingMethodBinding.isOverriding()