// return;
}
if (superBinding instanceof ParameterizedMethodBinding) {
superBinding = ((ParameterizedMethodBinding) superBinding).original();
}
EclipseFactory factory = ((AjLookupEnvironment) method.scope.environment()).factory;
if (depthCounter != 0 && targetClass.isInterface()) {// pr198196 - when calling MarkerInterface.super.XXX()
if (call.isSuperAccess() && !call.binding.isStatic()) {
MethodScope currentMethodScope = scope.methodScope();
SourceTypeBinding sourceType = currentMethodScope.enclosingSourceType();
FieldBinding field = sourceType.addSyntheticFieldForInnerclass(targetClass);
call.receiver = new KnownFieldReference(field, call.receiver.sourceStart, call.receiver.sourceEnd);
} else {
return;
}
} else if (depthCounter == 0) { // Allow case testSuperItds_pr198196_2/3
char[] accessName;
if (call.isSuperAccess() && !call.binding.isStatic()) {
call.receiver = new ThisReference(call.receiver.sourceStart, call.receiver.sourceEnd);
accessName = NameMangler.superDispatchMethod(factory.fromBinding(targetClass), new String(superBinding.selector))
.toCharArray();
} else if (call.receiver.isThis() && call.binding.isProtected() && !call.binding.isStatic()) {
// XXX this is a hack that violates some binary compatibility rules
ReferenceBinding superBindingDeclaringClass = superBinding.declaringClass;
if (superBindingDeclaringClass.isParameterizedType()) {
superBindingDeclaringClass = ((ParameterizedTypeBinding) superBindingDeclaringClass).type;
}
if (superBindingDeclaringClass.equals(targetClass)) {
accessName = NameMangler.protectedDispatchMethod(factory.fromBinding(targetClass),
new String(superBinding.selector)).toCharArray();
} else {
accessName = NameMangler.superDispatchMethod(factory.fromBinding(targetClass),
new String(superBinding.selector)).toCharArray();
}
} else {
return;
}
// ??? do we want these to be unique
MethodBinding superAccessBinding = new MethodBinding(ClassFileConstants.AccPublic, accessName, superBinding.returnType,
superBinding.parameters, superBinding.thrownExceptions, targetClass);
AstUtil.replaceMethodBinding(call, superAccessBinding);
} else {
return;
}
ResolvedMember targetMember = null;
if (superBinding.declaringClass.isParameterizedType()) { // pr206911
targetMember = factory.makeResolvedMember(superBinding, ((ParameterizedTypeBinding) superBinding.declaringClass)
.genericType());
} else {
targetMember = factory.makeResolvedMember(superBinding);
}
superMethodsCalled.add(targetMember);
}