UnresolvedType aspectTypeX = world.fromBinding(binding.declaringClass);
UnresolvedType targetTypeX = world.fromBinding(onTypeBinding);
ArrayBinding objectArrayBinding = scope.createArrayType(scope.getJavaLangObject(), 1);
MethodDeclaration pre = new MethodDeclaration(compilationResult);
pre.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic;
pre.returnType = AstUtil.makeTypeReference(objectArrayBinding);
pre.selector = NameMangler.postIntroducedConstructor(aspectTypeX, targetTypeX).toCharArray();
pre.arguments = AstUtil.copyArguments(this.arguments);
// XXX should do exceptions
pre.scope = new MethodScope(scope, pre, true);
// ??? do we need to do anything with scope???
// Use the factory to build a semi-correct resolvedmember - then patch it up with
// reset calls. This is SAFE
ResolvedMemberImpl preIntroducedConstructorRM = world.makeResolvedMember(binding);
preIntroducedConstructorRM.resetName(NameMangler.preIntroducedConstructor(aspectTypeX, targetTypeX));
preIntroducedConstructorRM.resetModifiers(Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL);
preIntroducedConstructorRM.resetReturnTypeToObjectArray();
pre.binding = world.makeMethodBinding(preIntroducedConstructorRM);
pre.bindArguments();
pre.bindThrownExceptions();
if (explicitConstructorCall == null) {
pre.statements = new Statement[] {};
} else {
pre.statements = new Statement[] { explicitConstructorCall };
}
InterTypeScope newParent = new InterTypeScope(scope, onTypeBinding);
pre.scope.parent = newParent;
pre.resolveStatements(); // newParent);
int nParams = pre.arguments.length;
MethodBinding explicitConstructor = null;
if (explicitConstructorCall != null) {
explicitConstructor = explicitConstructorCall.binding;