}
}
}
public EclipseTypeMunger build(ClassScope classScope) {
EclipseFactory factory = EclipseFactory.fromScopeLookupEnvironment(classScope);
resolveOnType(classScope);
if (ignoreFurtherInvestigation)
return null;
binding = classScope.referenceContext.binding.resolveTypesFor(binding);
if (binding == null) {
// if binding is null, we failed to find a type used in the method params, this error
// has already been reported.
this.ignoreFurtherInvestigation = true;
// return null;
throw new AbortCompilationUnit(compilationResult, null);
}
if (isTargetAnnotation(classScope, "method"))
return null; // Error message output in isTargetAnnotation
if (isTargetEnum(classScope, "method"))
return null; // Error message output in isTargetEnum
if (interTypeScope == null)
return null; // We encountered a problem building the scope, don't continue - error already reported
// This signature represents what we want consumers of the targetted type to 'see'
// must use the factory method to build it since there may be typevariables from the binding
// referred to in the parameters/returntype
ResolvedMemberImpl sig = factory.makeResolvedMemberForITD(binding, onTypeBinding, interTypeScope.getRecoveryAliases());
sig.resetName(new String(declaredSelector));
int resetModifiers = declaredModifiers;
if (binding.isVarargs())
resetModifiers = resetModifiers | Constants.ACC_VARARGS;
sig.resetModifiers(resetModifiers);
NewMethodTypeMunger myMunger = new NewMethodTypeMunger(sig, null, typeVariableAliases);
setMunger(myMunger);
ResolvedType aspectType = factory.fromEclipse(classScope.referenceContext.binding);
ResolvedMember me = myMunger.getInterMethodBody(aspectType);
this.selector = binding.selector = me.getName().toCharArray();
return new EclipseTypeMunger(factory, myMunger, aspectType, this);
}