--- /dev/null
+import java.util.ArrayList;
+import java.util.List;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+public class Main {
+
+ public List<? extends Element> getElements() {
+ return new ArrayList<Element>();
+ }
+
+ class Element {};
+
+ @Aspect
+ static abstract class Base<T> {
+ @Around("call(List<? extends T> *.*(..))")
+ public List<? extends T> elementList(ProceedingJoinPoint thisJoinPoint) {
+ try {
+ return (List<? extends T>)thisJoinPoint.proceed();
+ } catch (Throwable e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ @Aspect
+ static class Concrete extends Base<Element> {}
+
+ public static void main(String[] args) {
+ new Main().getElements();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+import java.util.ArrayList;
+import java.util.List;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+public class Main2 {
+
+ public List<? extends Element> getElements() {
+ return new ArrayList<Element>();
+ }
+
+ class Element {};
+
+ @Aspect
+ static abstract class Base<T> {
+ @Around("call(List<? extends T> *.*(..))")
+ public List<? extends T> elementList(ProceedingJoinPoint thisJoinPoint) {
+ try {
+ return (List<? extends T>)thisJoinPoint.proceed();
+ } catch (Throwable e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ @Aspect
+ static class Concrete extends Base<String> {} // pointcut won't match because not a call to "List<? extends String> *(..)"
+
+ public static void main(String[] args) {
+ new Main2().getElements();
+ }
+
+}
\ No newline at end of file
<compile files="GenericAspectY.aj" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Join point 'method-execution(void ParentChildRelationship$ParentHasChildren.addChild(C))' in Type 'ParentChildRelationship' (GenericAspectY.aj:53) advised by before advice from 'GenericAspectY' (GenericAspectY.aj:101) [with runtime test]"/>
<message kind="weave" text="Extending interface set for type 'Top' (GenericAspectY.aj) to include 'ParentChildRelationship$ParentHasChildren<Bottom>' (GenericAspectY.aj)"/>
- <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectY.aj:'java.util.List<C> ParentChildRelationship$ParentHasChildren.children')"/>
- <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'java.util.List<C> ParentChildRelationship$ParentHasChildren.getChildren()')"/>
- <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'void ParentChildRelationship$ParentHasChildren.addChild(C)')"/>
- <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'void ParentChildRelationship$ParentHasChildren.removeChild(C)')"/>
+ <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectY.aj:'java.util.List<Bottom> ParentChildRelationship$ParentHasChildren.children')"/>
+ <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'java.util.List<Bottom> ParentChildRelationship$ParentHasChildren.getChildren()')"/>
+ <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'void ParentChildRelationship$ParentHasChildren.addChild(Bottom)')"/>
+ <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'void ParentChildRelationship$ParentHasChildren.removeChild(Bottom)')"/>
<message kind="weave" text="Type 'ParentChildRelationship$ParentHasChildren' (GenericAspectY.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectY.aj:'java.util.List<C> ParentChildRelationship$ParentHasChildren.children')"/>
<message kind="weave" text="Type 'ParentChildRelationship$ParentHasChildren' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'java.util.List<C> ParentChildRelationship$ParentHasChildren.getChildren()')"/>
<message kind="weave" text="Type 'ParentChildRelationship$ParentHasChildren' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'void ParentChildRelationship$ParentHasChildren.addChild(C)')"/>
<message kind="weave" text="Type 'ParentChildRelationship$ParentHasChildren' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'void ParentChildRelationship$ParentHasChildren.removeChild(C)')"/>
<message kind="weave" text="Type 'ParentChildRelationship$ChildHasParent' (GenericAspectY.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectY.aj:'ParentChildRelationship$ParentHasChildren ParentChildRelationship$ChildHasParent.parent')"/>
- <message kind="weave" text="Type 'ParentChildRelationship$ChildHasParent' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'ParentChildRelationship$ParentHasChildren ParentChildRelationship$ChildHasParent.getParent()')"/>
+ <message kind="weave" text="Type 'ParentChildRelationship$ChildHasParent' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'P ParentChildRelationship$ChildHasParent.getParent()')"/>
<message kind="weave" text="Type 'ParentChildRelationship$ChildHasParent' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'void ParentChildRelationship$ChildHasParent.setParent(P)')"/>
<message kind="weave" text="Extending interface set for type 'Bottom' (GenericAspectY.aj) to include 'ParentChildRelationship$ChildHasParent<Top>' (GenericAspectY.aj)"/>
- <message kind="weave" text="Type 'Bottom' (GenericAspectY.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectY.aj:'ParentChildRelationship$ParentHasChildren ParentChildRelationship$ChildHasParent.parent')"/>
- <message kind="weave" text="Type 'Bottom' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'ParentChildRelationship$ParentHasChildren ParentChildRelationship$ChildHasParent.getParent()')"/>
- <message kind="weave" text="Type 'Bottom' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'void ParentChildRelationship$ChildHasParent.setParent(P)')"/>
+ <message kind="weave" text="Type 'Bottom' (GenericAspectY.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectY.aj:'Top ParentChildRelationship$ChildHasParent.parent')"/>
+ <message kind="weave" text="Type 'Bottom' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'Top ParentChildRelationship$ChildHasParent.getParent()')"/>
+ <message kind="weave" text="Type 'Bottom' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'void ParentChildRelationship$ChildHasParent.setParent(Top)')"/>
</compile>
<run class="GenericAspectY"/>
</ajc-test>
<compile files="GenericAspectZ.aj" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Join point 'method-execution(void ParentChildRelationship$ParentHasChildren.addChild(C))' in Type 'ParentChildRelationship' (GenericAspectZ.aj:53) advised by before advice from 'GenericAspectZ' (GenericAspectZ.aj:95) [with runtime test]"/>
<message kind="weave" text="Join point 'method-execution(void ParentChildRelationship$ParentHasChildren.removeChild(C))' in Type 'ParentChildRelationship' (GenericAspectZ.aj:65) advised by before advice from 'GenericAspectZ' (GenericAspectZ.aj:96) [with runtime test]"/>
+
<message kind="weave" text="Extending interface set for type 'Top' (GenericAspectZ.aj) to include 'ParentChildRelationship$ParentHasChildren<Bottom>' (GenericAspectZ.aj)"/>
+ <message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List<Bottom> ParentChildRelationship$ParentHasChildren.children')"/>
+ <message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List<Bottom> ParentChildRelationship$ParentHasChildren.getChildren()')"/>
+ <message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'void ParentChildRelationship$ParentHasChildren.addChild(Bottom)')"/>
+ <message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'void ParentChildRelationship$ParentHasChildren.removeChild(Bottom)')"/>
+ <message kind="weave" text="Type 'ParentChildRelationship$ParentHasChildren' (GenericAspectZ.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List<C> ParentChildRelationship$ParentHasChildren.children')"/>
+ <message kind="weave" text="Type 'ParentChildRelationship$ParentHasChildren' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List<C> ParentChildRelationship$ParentHasChildren.getChildren()')"/>
+ <message kind="weave" text="Type 'ParentChildRelationship$ParentHasChildren' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'void ParentChildRelationship$ParentHasChildren.addChild(C)')"/>
+ <message kind="weave" text="Type 'ParentChildRelationship$ParentHasChildren' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'void ParentChildRelationship$ParentHasChildren.removeChild(C)')"/>
+ <message kind="weave" text="Type 'ParentChildRelationship$ChildHasParent' (GenericAspectZ.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectZ.aj:'ParentChildRelationship$ParentHasChildren ParentChildRelationship$ChildHasParent.parent')"/>
+ <message kind="weave" text="Type 'ParentChildRelationship$ChildHasParent' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'P ParentChildRelationship$ChildHasParent.getParent()')"/>
+ <message kind="weave" text="Type 'ParentChildRelationship$ChildHasParent' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'void ParentChildRelationship$ChildHasParent.setParent(P)')"/>
+ <message kind="weave" text="Extending interface set for type 'Bottom' (GenericAspectZ.aj) to include 'ParentChildRelationship$ChildHasParent<Top>' (GenericAspectZ.aj)"/>
+ <message kind="weave" text="Type 'Bottom' (GenericAspectZ.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectZ.aj:'Top ParentChildRelationship$ChildHasParent.parent')"/>
+ <message kind="weave" text="Type 'Bottom' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'Top ParentChildRelationship$ChildHasParent.getParent()')"/>
+ <message kind="weave" text="Type 'Bottom' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'void ParentChildRelationship$ChildHasParent.setParent(Top)')"/>
+
+ <!--message kind="weave" text="Extending interface set for type 'Top' (GenericAspectZ.aj) to include 'ParentChildRelationship$ParentHasChildren<Bottom>' (GenericAspectZ.aj)"/>
<message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List<C> ParentChildRelationship$ParentHasChildren.children')"/>
<message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List<C> ParentChildRelationship$ParentHasChildren.getChildren()')"/>
<message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'void ParentChildRelationship$ParentHasChildren.addChild(C)')"/>
<message kind="weave" text="Extending interface set for type 'Bottom' (GenericAspectZ.aj) to include 'ParentChildRelationship$ChildHasParent<Top>' (GenericAspectZ.aj)"/>
<message kind="weave" text="Type 'Bottom' (GenericAspectZ.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectZ.aj:'ParentChildRelationship$ParentHasChildren ParentChildRelationship$ChildHasParent.parent')"/>
<message kind="weave" text="Type 'Bottom' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'ParentChildRelationship$ParentHasChildren ParentChildRelationship$ChildHasParent.getParent()')"/>
- <message kind="weave" text="Type 'Bottom' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'void ParentChildRelationship$ChildHasParent.setParent(P)')"/>
+ <message kind="weave" text="Type 'Bottom' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'void ParentChildRelationship$ChildHasParent.setParent(P)')"/-->
</compile>
<run class="GenericAspectZ"/>
</ajc-test>
<compile files="A2.aj" inpath="code.jar" options="-1.5,-showWeaveInfo">
<message kind="weave" text="Type 'BaseClass' (BaseClass.java) has intertyped field from 'A1' (A1.aj:'java.util.List<java.lang.String> BaseClass.list1')"/>
<message kind="weave" text="Type 'BaseClass' (BaseClass.java:12) advised by after advice from 'A1' (A1.aj:7)"/>
- <message kind="weave" text="Type 'BaseClass' (BaseClass.java) has intertyped field from 'A2' (A2.aj:'java.util.List<Z> BaseClass.list2')"/>
+ <message kind="weave" text="Type 'BaseClass' (BaseClass.java) has intertyped field from 'A2' (A2.aj:'java.util.List<N> BaseClass.list2')"/>
<message kind="weave" text="Type 'BaseClass' (BaseClass.java:13) advised by after advice from 'A2' (A2.aj:8)"/>
</compile>
<run class="BaseClass">
// public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); }
// public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");}
// public void testNegatedAnnotationMatchingProblem_pr153464() { runTest("negated annotation matching problem");}
+ public void testGenericsInPointcuts_pr161502() { runTest("generics in pointcuts");}
+ public void testGenericsInPointcuts_pr161502_2() { runTest("generics in pointcuts - 2");}
public void testNoNPEDueToMissingType_pr149908() { runTest("ensure no npe due to missing type");}
public void testNoNPEDueToMember_pr149908() { runTest("ensure no npe due to missing member");}
public void testPTWgetWithinTypeName_pr123423_1() { runTest("basic usage of getWithinTypeName");}
<compile files="BadInterface.java" options="-emacssym"/>
</ajc-test>
+ <ajc-test dir="bugs153/pr161502" title="generics in pointcuts">
+ <compile files="Main.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'method-call(java.util.List Main.getElements())' in Type 'Main' (Main.java:31) advised by around advice from 'Main$Concrete' (Main.java:18)"/>
+ </compile>
+ <run class="Main"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs153/pr161502" title="generics in pointcuts - 2">
+ <compile files="Main2.java" options="-1.5 -showWeaveInfo">
+ <message kind="warning" text="advice defined in Main2$Base has not been applied"/>
+ </compile>
+ <run class="Main2"/>
+ </ajc-test>
+
<ajc-test dir="bugs153/pr158624" title="generics and arrays">
<compile files="ValueChange.java" options="-1.5"/>
</ajc-test>
import java.util.Collection;
import java.util.Collections;
+import java.util.Map;
import org.aspectj.weaver.patterns.PerClause;
protected boolean isSuper = false;
public BoundedReferenceType(ReferenceType aBound, boolean isExtends, World world) {
- super((isExtends ? "+" : "-") + aBound.signature,world);
+ super((isExtends ? "+" : "-") + aBound.signature,aBound.signatureErasure,world);
this.isExtends = isExtends;
this.isSuper = !isExtends;
if (isExtends) {
return additionalInterfaceBounds;
}
+ public UnresolvedType parameterize(Map typeBindings) {
+ ReferenceType[] parameterizedAdditionalInterfaces = new ReferenceType[additionalInterfaceBounds==null?0:additionalInterfaceBounds.length];
+ for (int i=0; i<parameterizedAdditionalInterfaces.length;i++) {
+ parameterizedAdditionalInterfaces[i] = (ReferenceType)additionalInterfaceBounds[i].parameterize(typeBindings);
+ }
+ if (isExtends) {
+ return new BoundedReferenceType((ReferenceType)getUpperBound().parameterize(typeBindings),isExtends,world,parameterizedAdditionalInterfaces);
+ } else {
+ return new BoundedReferenceType((ReferenceType)getLowerBound().parameterize(typeBindings),isExtends,world,parameterizedAdditionalInterfaces);
+ }
+ }
+
/**
* only for use when resolving GenericsWildcardTypeX or a TypeVariableReferenceType
*/
public ShadowMunger parameterizeWith(ResolvedType declaringType,Map typeVariableMap) {
Checker ret = new Checker(
- getPointcut().parameterizeWith(typeVariableMap),
+ getPointcut().parameterizeWith(typeVariableMap,declaringType.getWorld()),
getStart(),
getEnd(),
this.sourceContext);
PerClause pclause = delegate.getPerClause();
if (isParameterizedType()) { // could cache the result here...
Map parameterizationMap = getAjMemberParameterizationMap();
- pclause = (PerClause)pclause.parameterizeWith(parameterizationMap);
+ pclause = (PerClause)pclause.parameterizeWith(parameterizationMap,world);
}
return pclause;
}
Map parameterizationMap = getAjMemberParameterizationMap();
for (Iterator iter = genericDeclares.iterator(); iter.hasNext();) {
Declare declareStatement = (Declare) iter.next();
- parameterizedDeclares.add(declareStatement.parameterizeWith(parameterizationMap));
+ parameterizedDeclares.add(declareStatement.parameterizeWith(parameterizationMap,world));
}
declares = parameterizedDeclares;
} else {
getName(),
parameterizedParameterTypes,
parameterizedReturnType,
- pointcut.parameterizeWith(typeMap)
+ pointcut.parameterizeWith(typeMap,newDeclaringType.getWorld())
);
ret.setTypeVariables(getTypeVariables());
ret.setSourceContext(getSourceContext());
* with the passed bindings.
*/
public UnresolvedType parameterize(Map typeBindings) {
- if (!isParameterizedType()) throw new IllegalStateException("Can't parameterize a type that is not a parameterized type");
+ if (!isParameterizedType()) return this;//throw new IllegalStateException("Can't parameterize a type that is not a parameterized type");
boolean workToDo = false;
for (int i = 0; i < typeParameters.length; i++) {
- if (typeParameters[i].isTypeVariableReference()) {
+ if (typeParameters[i].isTypeVariableReference() ||
+ (typeParameters[i] instanceof BoundedReferenceType)) {
workToDo = true;
}
}
TypeVariableReferenceType tvrt = (TypeVariableReferenceType) newTypeParams[i];
UnresolvedType binding = (UnresolvedType) typeBindings.get(tvrt.getTypeVariable().getName());
if (binding != null) newTypeParams[i] = binding;
+ } else if (newTypeParams[i] instanceof BoundedReferenceType) {
+ BoundedReferenceType brType = (BoundedReferenceType)newTypeParams[i];
+ newTypeParams[i] = brType.parameterize(typeBindings);
+// brType.parameterize(typeBindings)
}
}
return TypeFactory.createParameterizedType(getGenericType(), newTypeParams, getWorld());
TypeVariable newVariable = new TypeVariable(name,ubound,ibounds);
return newVariable;
}
+
+ public String getGenericSignature() {
+ return "T"+name+";";
+ }
+ public String getErasureSignature() {
+ return getFirstBound().getErasureSignature();
+ }
}
import java.io.DataOutputStream;
import java.io.IOException;
+import java.util.Map;
/**
* Represents a type variable in a type or generic method declaration
public TypeVariableReferenceType(
TypeVariable aTypeVariable,
World aWorld) {
- super(aTypeVariable.getFirstBound().getSignature(),
- aTypeVariable.getFirstBound().getErasureSignature(),
+ super(
+ aTypeVariable.getGenericSignature(),
+ aTypeVariable.getErasureSignature(),
aWorld);
this.typeVariable = aTypeVariable;
this.isExtends = false;
}
}
}
+
+ public UnresolvedType parameterize(Map typeBindings) {
+ UnresolvedType ut = (UnresolvedType) typeBindings.get(getName());
+ if (ut!=null) return ut;
+ return this;
+ }
public ReferenceType[] getAdditionalBounds() {
if (!resolvedIfBounds) {
}
public ShadowMunger parameterizeWith(ResolvedType declaringType,Map typeVariableMap) {
- Pointcut pc = getPointcut().parameterizeWith(typeVariableMap);
+ Pointcut pc = getPointcut().parameterizeWith(typeVariableMap,declaringType.getWorld());
BcelAdvice ret = null;
Member adviceSignature = signature;
} else if (munger.getKind().equals(ResolvedTypeMunger.FieldHost)) {
;//hidden
} else {
- ResolvedMember declaredSig = munger.getDeclaredSignature();
- if (declaredSig==null) declaredSig= munger.getSignature();
+ ResolvedMember declaredSig = munger.getSignature();
+// if (declaredSig==null) declaredSig= munger.getSignature();
weaver.getWorld().getMessageHandler().handleMessage(WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ITD,
new String[]{weaver.getLazyClassGen().getType().getName(),
tName,munger.getKind().toString().toLowerCase(),
import org.aspectj.weaver.IntMap;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.patterns.Bindings;
/* (non-Javadoc)
* @see org.aspectj.weaver.patterns.Pointcut#parameterizeWith(java.util.Map)
*/
- public Pointcut parameterizeWith(Map typeVariableMap) {
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
return this;
}
return this;
}
- public AnnotationTypePattern parameterizeWith(Map typeVariableMap) {
- AnnotationTypePattern newLeft = left.parameterizeWith(typeVariableMap);
- AnnotationTypePattern newRight = right.parameterizeWith(typeVariableMap);
+ public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) {
+ AnnotationTypePattern newLeft = left.parameterizeWith(typeVariableMap,w);
+ AnnotationTypePattern newRight = right.parameterizeWith(typeVariableMap,w);
AndAnnotationTypePattern ret = new AndAnnotationTypePattern(newLeft,newRight);
ret.copyLocationFrom(this);
return ret;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Test;
public class AndPointcut extends Pointcut {
return ret;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- AndPointcut ret = new AndPointcut(left.parameterizeWith(typeVariableMap),
- right.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ AndPointcut ret = new AndPointcut(left.parameterizeWith(typeVariableMap,w),
+ right.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
/**
* left && right
return this;
}
- public TypePattern parameterizeWith(Map typeVariableMap) {
- TypePattern newLeft = left.parameterizeWith(typeVariableMap);
- TypePattern newRight = right.parameterizeWith(typeVariableMap);
+ public TypePattern parameterizeWith(Map typeVariableMap,World w) {
+ TypePattern newLeft = left.parameterizeWith(typeVariableMap,w);
+ TypePattern newRight = right.parameterizeWith(typeVariableMap,w);
AndTypePattern ret = new AndTypePattern(newLeft,newRight);
ret.copyLocationFrom(this);
return ret;
return typePatterns;
}
- public AnnotationPatternList parameterizeWith(Map typeVariableMap) {
+ public AnnotationPatternList parameterizeWith(Map typeVariableMap,World w) {
AnnotationTypePattern[] parameterizedPatterns = new AnnotationTypePattern[this.typePatterns.length];
for (int i = 0; i < parameterizedPatterns.length; i++) {
- parameterizedPatterns[i] = this.typePatterns[i].parameterizeWith(typeVariableMap);
+ parameterizedPatterns[i] = this.typePatterns[i].parameterizeWith(typeVariableMap,w);
}
AnnotationPatternList ret = new AnnotationPatternList(parameterizedPatterns);
ret.copyLocationFrom(this);
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.ast.Var;
return Shadow.ALL_SHADOW_KINDS_BITS;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- AnnotationPointcut ret = new AnnotationPointcut((ExactAnnotationTypePattern)annotationTypePattern.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ AnnotationPointcut ret = new AnnotationPointcut((ExactAnnotationTypePattern)annotationTypePattern.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
public abstract void resolve(World world);
- public abstract AnnotationTypePattern parameterizeWith(Map/*name -> ResolvedType*/ typeVariableMap);
+ public abstract AnnotationTypePattern parameterizeWith(Map/*name -> ResolvedType*/ typeVariableMap,World w);
public boolean isAny() { return false; }
public boolean isAny() { return true; }
- public AnnotationTypePattern parameterizeWith(Map arg0) {
+ public AnnotationTypePattern parameterizeWith(Map arg0,World w) {
return this;
}
}
return visitor.visit(this, data);
}
- public AnnotationTypePattern parameterizeWith(Map arg0) {
+ public AnnotationTypePattern parameterizeWith(Map arg0,World w) {
return this;
}
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.ast.Var;
return Shadow.ALL_SHADOW_KINDS_BITS; // empty args() matches jps with no args
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- ArgsAnnotationPointcut ret = new ArgsAnnotationPointcut(arguments.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ ArgsAnnotationPointcut ret = new ArgsAnnotationPointcut(arguments.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
return arguments;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- ArgsPointcut ret = new ArgsPointcut(this.arguments.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ ArgsPointcut ret = new ArgsPointcut(this.arguments.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
}
}
- public AnnotationTypePattern parameterizeWith(Map typeVariableMap) {
+ public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) {
UnresolvedType newAnnotationType = annotationType;
if (annotationType.isTypeVariableReference()) {
TypeVariableReference t = (TypeVariableReference) annotationType;
import org.aspectj.weaver.IntMap;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
public class BindingTypePattern extends ExactTypePattern implements BindingPattern {
private int formalIndex;
}
}
- public TypePattern parameterizeWith(Map typeVariableMap) {
- ExactTypePattern superParameterized = (ExactTypePattern) super.parameterizeWith(typeVariableMap);
+ public TypePattern parameterizeWith(Map typeVariableMap,World w) {
+ ExactTypePattern superParameterized = (ExactTypePattern) super.parameterizeWith(typeVariableMap,w);
BindingTypePattern ret = new BindingTypePattern(superParameterized.getExactType(),this.formalIndex,this.isVarArgs);
ret.copyLocationFrom(this);
return ret;
return ret;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- CflowPointcut ret = new CflowPointcut(entry.parameterizeWith(typeVariableMap),isBelow,freeVars);
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ CflowPointcut ret = new CflowPointcut(entry.parameterizeWith(typeVariableMap,w),isBelow,freeVars);
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Expr;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.bcel.BcelCflowAccessVar;
throw new RuntimeException("unimplemented");
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
throw new RuntimeException("unimplemented");
}
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
public abstract class Declare extends PatternNode {
public static final byte ERROR_OR_WARNING = 1;
* Returns a version of this declare element in which all references to type variables
* are replaced with their bindings given in the map.
*/
- public abstract Declare parameterizeWith(Map typeVariableBindingMap);
+ public abstract Declare parameterizeWith(Map typeVariableBindingMap,World w);
/**
* Indicates if this declare should be treated like advice. If true, the
this.containingAspect = scope.getEnclosingType();
}
- public Declare parameterizeWith(Map typeVariableBindingMap) {
+ public Declare parameterizeWith(Map typeVariableBindingMap,World w) {
DeclareAnnotation ret;
if (this.kind == AT_TYPE) {
- ret = new DeclareAnnotation(kind,this.typePattern.parameterizeWith(typeVariableBindingMap));
+ ret = new DeclareAnnotation(kind,this.typePattern.parameterizeWith(typeVariableBindingMap,w));
} else {
- ret = new DeclareAnnotation(kind, this.sigPattern.parameterizeWith(typeVariableBindingMap));
+ ret = new DeclareAnnotation(kind, this.sigPattern.parameterizeWith(typeVariableBindingMap,w));
}
ret.annotationMethod = this.annotationMethod;
ret.annotationString = this.annotationString;
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
public class DeclareErrorOrWarning extends Declare {
private boolean isError;
pointcut = pointcut.resolve(scope);
}
- public Declare parameterizeWith(Map typeVariableBindingMap) {
- Declare ret = new DeclareErrorOrWarning(isError,pointcut.parameterizeWith(typeVariableBindingMap),message);
+ public Declare parameterizeWith(Map typeVariableBindingMap,World w) {
+ Declare ret = new DeclareErrorOrWarning(isError,pointcut.parameterizeWith(typeVariableBindingMap,w),message);
ret.copyLocationFrom(this);
return ret;
}
return visitor.visit(this,data);
}
- public Declare parameterizeWith(Map typeVariableBindingMap) {
+ public Declare parameterizeWith(Map typeVariableBindingMap,World w) {
DeclareParents ret =
new DeclareParents(
- child.parameterizeWith(typeVariableBindingMap),
- parents.parameterizeWith(typeVariableBindingMap),
+ child.parameterizeWith(typeVariableBindingMap,w),
+ parents.parameterizeWith(typeVariableBindingMap,w),
isExtends);
ret.copyLocationFrom(this);
return ret;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
public class DeclarePrecedence extends Declare {
private TypePatternList patterns;
return visitor.visit(this,data);
}
- public Declare parameterizeWith(Map typeVariableBindingMap) {
- DeclarePrecedence ret = new DeclarePrecedence(this.patterns.parameterizeWith(typeVariableBindingMap));
+ public Declare parameterizeWith(Map typeVariableBindingMap,World w) {
+ DeclarePrecedence ret = new DeclarePrecedence(this.patterns.parameterizeWith(typeVariableBindingMap,w));
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
public class DeclareSoft extends Declare {
private TypePattern exception;
return visitor.visit(this,data);
}
- public Declare parameterizeWith(Map typeVariableBindingMap) {
+ public Declare parameterizeWith(Map typeVariableBindingMap,World w) {
DeclareSoft ret =
new DeclareSoft(
- exception.parameterizeWith(typeVariableBindingMap),
- pointcut.parameterizeWith(typeVariableBindingMap));
+ exception.parameterizeWith(typeVariableBindingMap,w),
+ pointcut.parameterizeWith(typeVariableBindingMap,w));
ret.copyLocationFrom(this);
return ret;
}
return this;
}
- public AnnotationTypePattern parameterizeWith(Map typeVariableMap) {
+ public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) {
UnresolvedType newAnnotationType = annotationType;
if (annotationType.isTypeVariableReference()) {
TypeVariableReference t = (TypeVariableReference) annotationType;
import org.aspectj.weaver.TypeVariableReferenceType;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
public class ExactTypePattern extends TypePattern {
protected UnresolvedType type;
* return a version of this type pattern with all type variables references replaced
* by the corresponding entry in the map.
*/
- public TypePattern parameterizeWith(Map typeVariableMap) {
+ public TypePattern parameterizeWith(Map typeVariableMap,World w) {
UnresolvedType newType = type;
if (type.isTypeVariableReference()) {
TypeVariableReference t = (TypeVariableReference) type;
newType = (UnresolvedType) typeVariableMap.get(key);
}
} else if (type.isParameterizedType()) {
- newType = type.parameterize(typeVariableMap);
+ newType = w.resolve(type).parameterize(typeVariableMap);
}
ExactTypePattern ret = new ExactTypePattern(newType,includeSubtypes,isVarArgs);
- ret.annotationPattern = annotationPattern.parameterizeWith(typeVariableMap);
+ ret.annotationPattern = annotationPattern.parameterizeWith(typeVariableMap,w);
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
TypePattern.STATIC);
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- HandlerPointcut ret = new HandlerPointcut(exceptionType.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ HandlerPointcut ret = new HandlerPointcut(exceptionType.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
throw new UnsupportedOperationException("hasmethod/field do not support instanceof matching");
}
- public TypePattern parameterizeWith(Map typeVariableMap) {
- HasMemberTypePattern ret = new HasMemberTypePattern(signaturePattern.parameterizeWith(typeVariableMap));
+ public TypePattern parameterizeWith(Map typeVariableMap,World w) {
+ HasMemberTypePattern ret = new HasMemberTypePattern(signaturePattern.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Expr;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
}
// we can't touch "if" methods
- public Pointcut parameterizeWith(Map typeVariableMap) {
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
return this;
}
return ret;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- Pointcut ret = new KindedPointcut(kind, signature.parameterizeWith(typeVariableMap), munger );
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ Pointcut ret = new KindedPointcut(kind, signature.parameterizeWith(typeVariableMap,w), munger );
ret.copyLocationFrom(this);
return ret;
}
}
- public AnnotationTypePattern parameterizeWith(Map typeVariableMap) {
- AnnotationTypePattern newNegatedPattern = negatedPattern.parameterizeWith(typeVariableMap);
+ public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) {
+ AnnotationTypePattern newNegatedPattern = negatedPattern.parameterizeWith(typeVariableMap,w);
NotAnnotationTypePattern ret = new NotAnnotationTypePattern(newNegatedPattern);
ret.copyLocationFrom(this);
return ret;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Test;
public class NotPointcut extends Pointcut {
return ret;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- Pointcut ret = new NotPointcut(body.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ Pointcut ret = new NotPointcut(body.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
/**
* !TypePattern
return this;
}
- public TypePattern parameterizeWith(Map typeVariableMap) {
- TypePattern newNegatedPattern = negatedPattern.parameterizeWith(typeVariableMap);
+ public TypePattern parameterizeWith(Map typeVariableMap,World w) {
+ TypePattern newNegatedPattern = negatedPattern.parameterizeWith(typeVariableMap,w);
NotTypePattern ret = new NotTypePattern(newNegatedPattern);
ret.copyLocationFrom(this);
return ret;
return this;
}
- public AnnotationTypePattern parameterizeWith(Map typeVariableMap) {
- AnnotationTypePattern newLeft = left.parameterizeWith(typeVariableMap);
- AnnotationTypePattern newRight = right.parameterizeWith(typeVariableMap);
+ public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) {
+ AnnotationTypePattern newLeft = left.parameterizeWith(typeVariableMap,w);
+ AnnotationTypePattern newRight = right.parameterizeWith(typeVariableMap,w);
OrAnnotationTypePattern ret = new OrAnnotationTypePattern(newLeft,newRight);
ret.copyLocationFrom(this);
return ret;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Test;
public class OrPointcut extends Pointcut {
return ret;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- Pointcut ret = new OrPointcut(left.parameterizeWith(typeVariableMap),
- right.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ Pointcut ret = new OrPointcut(left.parameterizeWith(typeVariableMap,w),
+ right.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
/**
* left || right
return this;
}
- public TypePattern parameterizeWith(Map typeVariableMap) {
- TypePattern newLeft = left.parameterizeWith(typeVariableMap);
- TypePattern newRight = right.parameterizeWith(typeVariableMap);
+ public TypePattern parameterizeWith(Map typeVariableMap,World w) {
+ TypePattern newLeft = left.parameterizeWith(typeVariableMap,w);
+ TypePattern newRight = right.parameterizeWith(typeVariableMap,w);
OrTypePattern ret = new OrTypePattern(newLeft,newRight);
ret.copyLocationFrom(this);
return ret;
entry.resolve(scope);
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- PerCflow ret = new PerCflow(entry.parameterizeWith(typeVariableMap),isBelow);
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ PerCflow ret = new PerCflow(entry.parameterizeWith(typeVariableMap,w),isBelow);
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Test;
public class PerFromSuper extends PerClause {
}
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
return this;
}
entry.resolve(scope);
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- PerObject ret = new PerObject(entry.parameterizeWith(typeVariableMap),isThis);
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ PerObject ret = new PerObject(entry.parameterizeWith(typeVariableMap,w),isThis);
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Expr;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
// this method intentionally left blank
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
return this;
}
return kindSet;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- PerTypeWithin ret = new PerTypeWithin(typePattern.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ PerTypeWithin ret = new PerTypeWithin(typePattern.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
return visitor.visit(this, data);
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
return this;
}
}
}
}
- public abstract Pointcut parameterizeWith(Map typeVariableMap);
+ public abstract Pointcut parameterizeWith(Map typeVariableMap,World w);
}
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Test;
/**
TypePattern p = arguments.get(i);
//we are allowed to bind to pointcuts which use subtypes as this is type safe
if (typeVariableMap != null) {
- p = p.parameterizeWith(typeVariableMap);
+ p = p.parameterizeWith(typeVariableMap,scope.getWorld());
}
if (p == TypePattern.NO) {
scope.message(IMessage.ERROR, this,
try {
Pointcut ret = pointcutDec.getPointcut();
if (typeVariableMap != null && !hasBeenParameterized) {
- ret = ret.parameterizeWith(typeVariableMap);
+ ret = ret.parameterizeWith(typeVariableMap,searchStart.getWorld());
ret.hasBeenParameterized=true;
}
return ret.concretize(searchStart, declaringType, newBindings);
* Tricky thing is, we can't do this at the point in time this method will be called, so we make a
* version that will parameterize the pointcut it ultimately resolves to.
*/
- public Pointcut parameterizeWith(Map typeVariableMap) {
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
ReferencePointcut ret = new ReferencePointcut(onType,name,arguments);
ret.onTypeSymbolic = onTypeSymbolic;
ret.typeVariableMap = typeVariableMap;
* return a copy of this signature pattern in which every type variable reference
* is replaced by the corresponding entry in the map.
*/
- public SignaturePattern parameterizeWith(Map typeVariableMap) {
+ public SignaturePattern parameterizeWith(Map typeVariableMap,World w) {
SignaturePattern ret = new SignaturePattern(
kind,
modifiers,
- returnType.parameterizeWith(typeVariableMap),
- declaringType.parameterizeWith(typeVariableMap),
+ returnType.parameterizeWith(typeVariableMap,w),
+ declaringType.parameterizeWith(typeVariableMap,w),
name,
- parameterTypes.parameterizeWith(typeVariableMap),
- throwsPattern.parameterizeWith(typeVariableMap),
- annotationPattern.parameterizeWith(typeVariableMap));
+ parameterTypes.parameterizeWith(typeVariableMap,w),
+ throwsPattern.parameterizeWith(typeVariableMap,w),
+ annotationPattern.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.ast.Var;
return isThis ? thisKindSet : targetKindSet;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- ExactAnnotationTypePattern newPattern = (ExactAnnotationTypePattern) this.annotationTypePattern.parameterizeWith(typeVariableMap);
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ ExactAnnotationTypePattern newPattern = (ExactAnnotationTypePattern) this.annotationTypePattern.parameterizeWith(typeVariableMap,w);
if (newPattern.getAnnotationType() instanceof ResolvedType) {
verifyRuntimeRetention((ResolvedType)newPattern.getResolvedAnnotationType());
}
- ThisOrTargetAnnotationPointcut ret = new ThisOrTargetAnnotationPointcut(isThis,(ExactAnnotationTypePattern)annotationTypePattern.parameterizeWith(typeVariableMap));
+ ThisOrTargetAnnotationPointcut ret = new ThisOrTargetAnnotationPointcut(isThis,(ExactAnnotationTypePattern)annotationTypePattern.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.ast.Var;
public boolean isThis() { return isThis; }
- public Pointcut parameterizeWith(Map typeVariableMap) {
- ThisOrTargetPointcut ret = new ThisOrTargetPointcut(isThis,type.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ ThisOrTargetPointcut ret = new ThisOrTargetPointcut(isThis,type.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
return this;
}
- public ThrowsPattern parameterizeWith(Map/*name -> resolved type*/ typeVariableMap) {
+ public ThrowsPattern parameterizeWith(Map/*name -> resolved type*/ typeVariableMap,World w) {
ThrowsPattern ret = new ThrowsPattern(
- required.parameterizeWith(typeVariableMap),
- forbidden.parameterizeWith(typeVariableMap));
+ required.parameterizeWith(typeVariableMap,w),
+ forbidden.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
* return a version of this type pattern in which all type variable references have been
* replaced by their corresponding entry in the map.
*/
- public abstract TypePattern parameterizeWith(Map typeVariableMap);
+ public abstract TypePattern parameterizeWith(Map typeVariableMap,World w);
public void postRead(ResolvedType enclosingType) {
}
return visitor.visit(this, data);
}
- public TypePattern parameterizeWith(Map typeVariableMap) {
+ public TypePattern parameterizeWith(Map typeVariableMap,World w) {
return this;
}
return visitor.visit(this, data);
}
- public TypePattern parameterizeWith(Map arg0) {
+ public TypePattern parameterizeWith(Map arg0,World w) {
return this;
}
}
return FuzzyBoolean.MAYBE;
}
- public TypePattern parameterizeWith(Map typeVariableMap) {
- AnyWithAnnotationTypePattern ret = new AnyWithAnnotationTypePattern(this.annotationPattern.parameterizeWith(typeVariableMap));
+ public TypePattern parameterizeWith(Map typeVariableMap,World w) {
+ AnyWithAnnotationTypePattern ret = new AnyWithAnnotationTypePattern(this.annotationPattern.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
return visitor.visit(this, data);
}
- public TypePattern parameterizeWith(Map arg0) {
+ public TypePattern parameterizeWith(Map arg0,World w) {
return this;
}
}
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
public class TypePatternList extends PatternNode {
private TypePattern[] typePatterns;
* @param typeVariableMap
* @return
*/
- public TypePatternList parameterizeWith(Map typeVariableMap) {
+ public TypePatternList parameterizeWith(Map typeVariableMap,World w) {
TypePattern[] parameterizedPatterns = new TypePattern[typePatterns.length];
for (int i = 0; i < parameterizedPatterns.length; i++) {
- parameterizedPatterns[i] = typePatterns[i].parameterizeWith(typeVariableMap);
+ parameterizedPatterns[i] = typePatterns[i].parameterizeWith(typeVariableMap,w);
}
return new TypePatternList(parameterizedPatterns);
}
}
}
- public AnnotationTypePattern parameterizeWith(Map typeVariableMap) {
- WildAnnotationTypePattern ret = new WildAnnotationTypePattern(typePattern.parameterizeWith(typeVariableMap));
+ public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) {
+ WildAnnotationTypePattern ret = new WildAnnotationTypePattern(typePattern.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
ret.resolved = resolved;
return ret;
return buf.toString();
}
- public TypePattern parameterizeWith(Map typeVariableMap) {
+ public TypePattern parameterizeWith(Map typeVariableMap,World w) {
NamePattern[] newNamePatterns = new NamePattern[namePatterns.length];
for(int i=0; i<namePatterns.length;i++) { newNamePatterns[i] = namePatterns[i]; }
if (newNamePatterns.length == 1) {
includeSubtypes,
dim,
isVarArgs,
- typeParameters.parameterizeWith(typeVariableMap)
+ typeParameters.parameterizeWith(typeVariableMap,w)
);
- ret.annotationPattern = this.annotationPattern.parameterizeWith(typeVariableMap);
+ ret.annotationPattern = this.annotationPattern.parameterizeWith(typeVariableMap,w);
if (additionalInterfaceBounds == null) {
ret.additionalInterfaceBounds = null;
} else {
ret.additionalInterfaceBounds = new TypePattern[additionalInterfaceBounds.length];
for (int i = 0; i < additionalInterfaceBounds.length; i++) {
- ret.additionalInterfaceBounds[i] = additionalInterfaceBounds[i].parameterizeWith(typeVariableMap);
+ ret.additionalInterfaceBounds[i] = additionalInterfaceBounds[i].parameterizeWith(typeVariableMap,w);
}
}
- ret.upperBound = upperBound != null ? upperBound.parameterizeWith(typeVariableMap) : null;
- ret.lowerBound = lowerBound != null ? lowerBound.parameterizeWith(typeVariableMap) : null;
+ ret.upperBound = upperBound != null ? upperBound.parameterizeWith(typeVariableMap,w) : null;
+ ret.lowerBound = lowerBound != null ? lowerBound.parameterizeWith(typeVariableMap,w) : null;
ret.isGeneric = isGeneric;
ret.knownMatches = knownMatches;
ret.importedPrefixes = importedPrefixes;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.ast.Var;
return Shadow.ALL_SHADOW_KINDS_BITS;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- WithinAnnotationPointcut ret = new WithinAnnotationPointcut(this.annotationTypePattern.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ WithinAnnotationPointcut ret = new WithinAnnotationPointcut(this.annotationTypePattern.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.ast.Var;
return matchedShadowKinds;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- WithinCodeAnnotationPointcut ret = new WithinCodeAnnotationPointcut((ExactAnnotationTypePattern)this.annotationTypePattern.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ WithinCodeAnnotationPointcut ret = new WithinCodeAnnotationPointcut((ExactAnnotationTypePattern)this.annotationTypePattern.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
return Shadow.ALL_SHADOW_KINDS_BITS;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- WithinPointcut ret = new WithinPointcut(this.typePattern.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ WithinPointcut ret = new WithinPointcut(this.typePattern.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.VersionedDataInputStream;
import org.aspectj.weaver.WeaverMessages;
+import org.aspectj.weaver.World;
import org.aspectj.weaver.ast.Literal;
import org.aspectj.weaver.ast.Test;
return matchedShadowKinds;
}
- public Pointcut parameterizeWith(Map typeVariableMap) {
- WithincodePointcut ret = new WithincodePointcut(signature.parameterizeWith(typeVariableMap));
+ public Pointcut parameterizeWith(Map typeVariableMap,World w) {
+ WithincodePointcut ret = new WithincodePointcut(signature.parameterizeWith(typeVariableMap,w));
ret.copyLocationFrom(this);
return ret;
}