@Override public ResolvedMember getMatchingSyntheticMember(Member member, ResolvedType aspectType) { ResolvedMember ret = getSyntheticConstructor(); if (ResolvedType.matches(ret, member)) { return getSignature(); } return super.getMatchingSyntheticMember(member, aspectType); }
public void check(World world) { if (getSignature().getDeclaringType().resolve(world).isAspect()) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_CONS_ON_ASPECT), getSignature() .getSourceLocation(), null); } }
public LazyMethodGen locateAnnotationHolderForMethodCtorMunger(LazyClassGen clazz, ConcreteTypeMunger methodCtorMunger) { ResolvedTypeMunger rtMunger = methodCtorMunger.getMunger(); ResolvedMember lookingFor = null; if (rtMunger instanceof NewMethodTypeMunger) { NewMethodTypeMunger nftm = (NewMethodTypeMunger) rtMunger; lookingFor = AjcMemberMaker.interMethodDispatcher(nftm.getSignature(), methodCtorMunger.getAspectType()); } else if (rtMunger instanceof NewConstructorTypeMunger) { NewConstructorTypeMunger nftm = (NewConstructorTypeMunger) rtMunger; lookingFor = AjcMemberMaker.postIntroducedConstructor(methodCtorMunger.getAspectType(), nftm.getSignature() .getDeclaringType(), nftm.getSignature().getParameterTypes()); } else { throw new BCException("Not sure what this is: " + methodCtorMunger); } String name = lookingFor.getName(); String paramSignature = lookingFor.getParameterSignature(); for (LazyMethodGen member : clazz.getMethodGens()) { if (member.getName().equals(name) && member.getParameterSignature().equals(paramSignature)) { return member; } } return null; }
/** * see ResolvedTypeMunger.parameterizedFor(ResolvedType) */ @Override public ResolvedTypeMunger parameterizedFor(ResolvedType target) { ResolvedType genericType = target; if (target.isRawType() || target.isParameterizedType()) { genericType = genericType.getGenericType(); } ResolvedMember parameterizedSignature = null; // If we are parameterizing it for a generic type, we just need to 'swap the letters' from the ones used // in the original ITD declaration to the ones used in the actual target type declaration. if (target.isGenericType()) { TypeVariable vars[] = target.getTypeVariables(); UnresolvedTypeVariableReferenceType[] varRefs = new UnresolvedTypeVariableReferenceType[vars.length]; for (int i = 0; i < vars.length; i++) { varRefs[i] = new UnresolvedTypeVariableReferenceType(vars[i]); } parameterizedSignature = getSignature().parameterizedWith(varRefs, genericType, true, typeVariableAliases); } else { // For raw and 'normal' parameterized targets (e.g. Interface, Interface<String>) parameterizedSignature = getSignature().parameterizedWith(target.getTypeParameters(), genericType, target.isParameterizedType(), typeVariableAliases); } NewConstructorTypeMunger nctm = new NewConstructorTypeMunger(parameterizedSignature, syntheticConstructor, explicitConstructor, getSuperMethodsCalled(), typeVariableAliases); nctm.setSourceLocation(getSourceLocation()); return nctm; }
} else if (element.getMunger() instanceof NewConstructorTypeMunger) { NewConstructorTypeMunger nctm = (NewConstructorTypeMunger) element.getMunger(); itdMatch = declA.matches(nctm.getSignature(), world);
mg.setEffectiveSignature(newConstructorTypeMunger.getSignature(), Shadow.ConstructorExecution, true); newConstructorTypeMunger.getSignature().getParameterTypes()); AnnotationAJ annotationsOnRealMember[] = null; ResolvedMember realMember = getRealMemberForITDFromAspect(aspectType, interMethodDispatcher, true); UnresolvedType[] declaredParams = newConstructorTypeMunger.getSignature().getParameterTypes(); Type[] paramTypes = mg.getArgumentTypes(); int frameIndex = 1;