List<ResolvedMember> newParentMethods = newParent.getMethodsWithoutIterator(false, true, false);
for (ResolvedMember newParentMethod : newParentMethods) {
String newParentMethodName = newParentMethod.getName();
// Ignore abstract ajc$interField prefixed methods
if (newParentMethod.isAbstract() && !newParentMethodName.startsWith("ajc$interField")) {
ResolvedMember discoveredImpl = null;
List<ResolvedMember> targetMethods = newParentTarget.getType().getMethodsWithoutIterator(false, true, false);
for (ResolvedMember targetMethod : targetMethods) {
if (!targetMethod.isAbstract() && targetMethod.getName().equals(newParentMethodName)) {
String newParentMethodSig = newParentMethod.getParameterSignature(); // ([TT;)
String targetMethodSignature = targetMethod.getParameterSignature(); // ([Ljava/lang/Object;)
// could be a match
if (targetMethodSignature.equals(newParentMethodSig)) {
discoveredImpl = targetMethod;
} else {
// Does the erasure match? In which case a bridge method will be created later to
// satisfy the abstract method
if (targetMethod.hasBackingGenericMember()
&& targetMethod.getBackingGenericMember().getParameterSignature().equals(newParentMethodSig)) {
discoveredImpl = targetMethod;
} else if (newParentMethod.hasBackingGenericMember()) {
if (newParentMethod.getBackingGenericMember().getParameterSignature().equals(targetMethodSignature)) {
discoveredImpl = targetMethod;
}
}
}
if (discoveredImpl != null) {
break;
}
}
}
if (discoveredImpl == null) {
// didnt find a valid implementation, lets check the
// ITDs on this type to see if they satisfy it
boolean satisfiedByITD = false;
for (ConcreteTypeMunger m : newParentTarget.getType().getInterTypeMungersIncludingSupers()) {
if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.Method) {
ResolvedMember sig = m.getSignature();
if (!Modifier.isAbstract(sig.getModifiers())) {
// If the ITD shares a type variable with some target type, we need to tailor it
// for that type
if (m.isTargetTypeParameterized()) {
ResolvedType genericOnType = getWorld().resolve(sig.getDeclaringType()).getGenericType();
m = m.parameterizedFor(newParent.discoverActualOccurrenceOfTypeInHierarchy(genericOnType));
// possible sig change when type parameters filled in
sig = m.getSignature();
}
if (ResolvedType.matches(
AjcMemberMaker.interMethod(sig, m.getAspectType(),
sig.getDeclaringType().resolve(weaver.getWorld()).isInterface()), newParentMethod)) {
satisfiedByITD = true;
}
}
} else if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate2) {
// AV - that should be enough, no need to check more