From b3be9410fcd333a516e6a220d30f9705b7aa9748 Mon Sep 17 00:00:00 2001 From: acolyer Date: Thu, 24 Nov 2005 13:02:32 +0000 Subject: [PATCH] hopefully the last word on parameterizing pointcuts in all their various glorious flavours --- .../weaver/ResolvedPointcutDefinition.java | 4 ++-- .../weaver/patterns/ReferencePointcut.java | 1 + .../weaver/patterns/WildTypePattern.java | 19 ++++++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/ResolvedPointcutDefinition.java b/weaver/src/org/aspectj/weaver/ResolvedPointcutDefinition.java index cf3d5967d..4335957e1 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedPointcutDefinition.java +++ b/weaver/src/org/aspectj/weaver/ResolvedPointcutDefinition.java @@ -147,8 +147,8 @@ public class ResolvedPointcutDefinition extends ResolvedMemberImpl { ret.setSourceContext(getSourceContext()); ret.setPosition(getStart(),getEnd()); ret.setParameterNames(getParameterNames()); - //return ret; - return this; + return ret; + //return this; } // for testing diff --git a/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java b/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java index 2f2c965a4..f20223cb4 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java @@ -194,6 +194,7 @@ public class ReferencePointcut extends Pointcut { return; } + //if (onType == null) onType = pointcutDef.getDeclaringType(); if (onType != null) { if (onType.isParameterizedType()) { // build a type map mapping type variable names in the generic type to diff --git a/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java index d3e4cfff3..8313460bd 100644 --- a/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java @@ -18,6 +18,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.StringTokenizer; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.Message; @@ -532,8 +533,24 @@ public class WildTypePattern extends TypePattern { } public TypePattern parameterizeWith(Map typeVariableMap) { + NamePattern[] newNamePatterns = new NamePattern[namePatterns.length]; + for(int i=0; i