소스 검색

commented out solution to mixin problem

tags/V1_6_3rc1
aclement 15 년 전
부모
커밋
024421468c
1개의 변경된 파일16개의 추가작업 그리고 2개의 파일을 삭제
  1. 16
    2
      weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java

+ 16
- 2
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java 파일 보기

@@ -52,6 +52,7 @@ import org.aspectj.weaver.MethodDelegateTypeMunger;
import org.aspectj.weaver.NameMangler;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.ResolvedMemberImpl;
import org.aspectj.weaver.ResolvedPointcutDefinition;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.UnresolvedType;
@@ -711,8 +712,21 @@ public class AtAjAttributes {
// return false;
// }
hasAtLeastOneMethod = true;
MethodDelegateTypeMunger mdtm = new MethodDelegateTypeMunger(method, struct.enclosingType,
defaultImplClassName, typePattern);
// What we are saying here:
// We have this method 'method' and we want to put a forwarding method into a type that matches
// typePattern that should delegate to the version of the method in 'defaultImplClassName'

// Now the method may be from a supertype but the declaring type of the method we pass into the type
// munger is what is used to determine the type of the field that hosts the delegate instance.
// So here we create a modified method with an alternative declaring type so that we lookup
// the right field. See pr164016. Generics will probably break this horribly
/*
ResolvedMemberImpl methodWithAlteredDeclaringType = new ResolvedMemberImpl(method.getKind(), fieldType,
method.getModifiers(), method.getReturnType(), method.getName(), method.getParameterTypes(),
method.getExceptions());
*/
MethodDelegateTypeMunger mdtm = new MethodDelegateTypeMunger(method,
struct.enclosingType, defaultImplClassName, typePattern);
mdtm.setSourceLocation(struct.enclosingType.getSourceLocation());
struct.ajAttributes.add(new AjAttribute.TypeMunger(mdtm));
}

Loading…
취소
저장