diff options
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/ReferenceType.java | 15 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/ResolvedType.java | 19 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java | 2 |
3 files changed, 18 insertions, 18 deletions
diff --git a/weaver/src/org/aspectj/weaver/ReferenceType.java b/weaver/src/org/aspectj/weaver/ReferenceType.java index fbf9ec0df..a3a22052b 100644 --- a/weaver/src/org/aspectj/weaver/ReferenceType.java +++ b/weaver/src/org/aspectj/weaver/ReferenceType.java @@ -475,21 +475,6 @@ public class ReferenceType extends ResolvedType { return declares; } - private boolean ajMembersNeedParameterization() { - if (isParameterizedType()) return true; - if (getSuperclass() != null) return ((ReferenceType)getSuperclass()).ajMembersNeedParameterization(); - return false; - } - - private Map getAjMemberParameterizationMap() { - Map myMap = getMemberParameterizationMap(); - if (myMap.size() == 0) { - // might extend a parameterized aspect that we also need to consider... - if (getSuperclass() != null) return ((ReferenceType)getSuperclass()).getAjMemberParameterizationMap(); - } - return myMap; - } - protected Collection getTypeMungers() { return delegate.getTypeMungers(); } protected Collection getPrivilegedAccesses() { return delegate.getPrivilegedAccesses(); } diff --git a/weaver/src/org/aspectj/weaver/ResolvedType.java b/weaver/src/org/aspectj/weaver/ResolvedType.java index 1c3f5a637..ba8d60a48 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedType.java +++ b/weaver/src/org/aspectj/weaver/ResolvedType.java @@ -678,11 +678,11 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl List l = new ArrayList(); ResolvedMember[] methods = getDeclaredMethods(); if (isParameterizedType()) methods = getGenericType().getDeclaredMethods(); - Map typeVariableMap = getMemberParameterizationMap(); + Map typeVariableMap = getAjMemberParameterizationMap(); for (int i=0, len = methods.length; i < len; i++) { ShadowMunger munger = methods[i].getAssociatedShadowMunger(); if (munger != null) { - if (this.isParameterizedType()) { + if (ajMembersNeedParameterization()) { //munger.setPointcut(munger.getPointcut().parameterizeWith(typeVariableMap)); munger = munger.parameterizeWith(this,typeVariableMap); if (munger instanceof Advice) { @@ -2003,5 +2003,20 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl } return parameterizedWithAMemberTypeVariable.alwaysTrue(); } + + protected boolean ajMembersNeedParameterization() { + if (isParameterizedType()) return true; + if (getSuperclass() != null) return ((ReferenceType)getSuperclass()).ajMembersNeedParameterization(); + return false; + } + + protected Map getAjMemberParameterizationMap() { + Map myMap = getMemberParameterizationMap(); + if (myMap.size() == 0) { + // might extend a parameterized aspect that we also need to consider... + if (getSuperclass() != null) return ((ReferenceType)getSuperclass()).getAjMemberParameterizationMap(); + } + return myMap; + } } diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java index a27e3270a..e74bb537d 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java @@ -93,7 +93,7 @@ public class BcelAdvice extends Advice { BcelAdvice ret = null; Member adviceSignature = signature; // allows for around advice where the return value is a type variable (see pr115250) - if (signature instanceof ResolvedMember) { + if (signature instanceof ResolvedMember && signature.getDeclaringType().isGenericType()) { adviceSignature = ((ResolvedMember)signature).parameterizedWith(declaringType.getTypeParameters(),declaringType,declaringType.isParameterizedType()); } ret = new BcelAdvice(this.attribute,pc,adviceSignature,this.concreteAspect); |