]> source.dussan.org Git - aspectj.git/commitdiff
tests and fixes for 161502: annotation style generic pointcuts (!)
authoraclement <aclement>
Tue, 24 Oct 2006 12:42:57 +0000 (12:42 +0000)
committeraclement <aclement>
Tue, 24 Oct 2006 12:42:57 +0000 (12:42 +0000)
64 files changed:
tests/bugs153/pr161502/Main.java [new file with mode: 0644]
tests/bugs153/pr161502/Main2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
weaver/src/org/aspectj/weaver/BoundedReferenceType.java
weaver/src/org/aspectj/weaver/Checker.java
weaver/src/org/aspectj/weaver/ReferenceType.java
weaver/src/org/aspectj/weaver/ResolvedPointcutDefinition.java
weaver/src/org/aspectj/weaver/ResolvedType.java
weaver/src/org/aspectj/weaver/TypeVariable.java
weaver/src/org/aspectj/weaver/TypeVariableReferenceType.java
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
weaver/src/org/aspectj/weaver/internal/tools/PointcutDesignatorHandlerBasedPointcut.java
weaver/src/org/aspectj/weaver/patterns/AndAnnotationTypePattern.java
weaver/src/org/aspectj/weaver/patterns/AndPointcut.java
weaver/src/org/aspectj/weaver/patterns/AndTypePattern.java
weaver/src/org/aspectj/weaver/patterns/AnnotationPatternList.java
weaver/src/org/aspectj/weaver/patterns/AnnotationPointcut.java
weaver/src/org/aspectj/weaver/patterns/AnnotationTypePattern.java
weaver/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java
weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java
weaver/src/org/aspectj/weaver/patterns/BindingAnnotationTypePattern.java
weaver/src/org/aspectj/weaver/patterns/BindingTypePattern.java
weaver/src/org/aspectj/weaver/patterns/CflowPointcut.java
weaver/src/org/aspectj/weaver/patterns/ConcreteCflowPointcut.java
weaver/src/org/aspectj/weaver/patterns/Declare.java
weaver/src/org/aspectj/weaver/patterns/DeclareAnnotation.java
weaver/src/org/aspectj/weaver/patterns/DeclareErrorOrWarning.java
weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java
weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java
weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java
weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java
weaver/src/org/aspectj/weaver/patterns/HandlerPointcut.java
weaver/src/org/aspectj/weaver/patterns/HasMemberTypePattern.java
weaver/src/org/aspectj/weaver/patterns/IfPointcut.java
weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java
weaver/src/org/aspectj/weaver/patterns/NotAnnotationTypePattern.java
weaver/src/org/aspectj/weaver/patterns/NotPointcut.java
weaver/src/org/aspectj/weaver/patterns/NotTypePattern.java
weaver/src/org/aspectj/weaver/patterns/OrAnnotationTypePattern.java
weaver/src/org/aspectj/weaver/patterns/OrPointcut.java
weaver/src/org/aspectj/weaver/patterns/OrTypePattern.java
weaver/src/org/aspectj/weaver/patterns/PerCflow.java
weaver/src/org/aspectj/weaver/patterns/PerFromSuper.java
weaver/src/org/aspectj/weaver/patterns/PerObject.java
weaver/src/org/aspectj/weaver/patterns/PerSingleton.java
weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java
weaver/src/org/aspectj/weaver/patterns/Pointcut.java
weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java
weaver/src/org/aspectj/weaver/patterns/SignaturePattern.java
weaver/src/org/aspectj/weaver/patterns/ThisOrTargetAnnotationPointcut.java
weaver/src/org/aspectj/weaver/patterns/ThisOrTargetPointcut.java
weaver/src/org/aspectj/weaver/patterns/ThrowsPattern.java
weaver/src/org/aspectj/weaver/patterns/TypePattern.java
weaver/src/org/aspectj/weaver/patterns/TypePatternList.java
weaver/src/org/aspectj/weaver/patterns/WildAnnotationTypePattern.java
weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java
weaver/src/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java
weaver/src/org/aspectj/weaver/patterns/WithinCodeAnnotationPointcut.java
weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java
weaver/src/org/aspectj/weaver/patterns/WithincodePointcut.java

diff --git a/tests/bugs153/pr161502/Main.java b/tests/bugs153/pr161502/Main.java
new file mode 100644 (file)
index 0000000..81a1eae
--- /dev/null
@@ -0,0 +1,34 @@
+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
diff --git a/tests/bugs153/pr161502/Main2.java b/tests/bugs153/pr161502/Main2.java
new file mode 100644 (file)
index 0000000..b87503b
--- /dev/null
@@ -0,0 +1,34 @@
+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
index 503eccbe86ea3eb1a5b3ff65e21a5ef80c440e91..1ca3b4b593e711b8c5c52414ef43d1067fe2f019 100644 (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&lt;Bottom&gt;' (GenericAspectY.aj)"/>
-               <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectY.aj:'java.util.List&lt;C&gt; ParentChildRelationship$ParentHasChildren.children')"/>
-               <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'java.util.List&lt;C&gt; 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&lt;Bottom&gt; ParentChildRelationship$ParentHasChildren.children')"/>
+               <message kind="weave" text="Type 'Top' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'java.util.List&lt;Bottom&gt; 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&lt;C&gt; ParentChildRelationship$ParentHasChildren.children')"/>
                <message kind="weave" text="Type 'ParentChildRelationship$ParentHasChildren' (GenericAspectY.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectY.aj:'java.util.List&lt;C&gt; 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&lt;Top&gt;' (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&lt;Bottom&gt;' (GenericAspectZ.aj)"/>
+               <message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List&lt;Bottom&gt; ParentChildRelationship$ParentHasChildren.children')"/>
+               <message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List&lt;Bottom&gt; 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&lt;C&gt; ParentChildRelationship$ParentHasChildren.children')"/>
+               <message kind="weave" text="Type 'ParentChildRelationship$ParentHasChildren' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List&lt;C&gt; 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&lt;Top&gt;' (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&lt;Bottom&gt;' (GenericAspectZ.aj)"/>
                <message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped field from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List&lt;C&gt; ParentChildRelationship$ParentHasChildren.children')"/>
                <message kind="weave" text="Type 'Top' (GenericAspectZ.aj) has intertyped method from 'ParentChildRelationship' (GenericAspectZ.aj:'java.util.List&lt;C&gt; 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&lt;Top&gt;' (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&lt;java.lang.String&gt; 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&lt;Z&gt; BaseClass.list2')"/>
+            <message kind="weave" text="Type 'BaseClass' (BaseClass.java) has intertyped field from 'A2' (A2.aj:'java.util.List&lt;N&gt; BaseClass.list2')"/>
          <message kind="weave" text="Type 'BaseClass' (BaseClass.java:13) advised by after advice from 'A2' (A2.aj:8)"/>
        </compile>
         <run class="BaseClass">
index e642b4c601358ca07f764ae70e79fc1786ea27e9..3790fcad6e6f87702f8ed89d6335a41aba65a6f7 100644 (file)
@@ -28,6 +28,8 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   // 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");}
index edf0868e64f6068b19780ac0d4731afcf68ed953..ee379452dbeaafc7d86e21fe04924df071b18dfe 100644 (file)
       <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> 
index b1dbfe00f7aef2a0a8b0f6020bf82869a52fa1cc..456796e8c9c825d61db5c48feceb3b4d563f3f2d 100644 (file)
@@ -13,6 +13,7 @@ package org.aspectj.weaver;
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Map;
 
 import org.aspectj.weaver.patterns.PerClause;
 
@@ -33,7 +34,7 @@ public class BoundedReferenceType extends ReferenceType {
        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) { 
@@ -54,6 +55,18 @@ public class BoundedReferenceType extends ReferenceType {
                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
         */
index b7990c88c9f2d808b6fd8f6646aa8a07f3976a71..9ff4dce5f463367588c6c068167755b803bbaf93 100644 (file)
@@ -57,7 +57,7 @@ public class Checker extends ShadowMunger {
        
        public ShadowMunger parameterizeWith(ResolvedType declaringType,Map typeVariableMap) {
                Checker ret = new Checker(
-                                                       getPointcut().parameterizeWith(typeVariableMap),
+                                                       getPointcut().parameterizeWith(typeVariableMap,declaringType.getWorld()),
                                                        getStart(),
                                                        getEnd(),
                                                        this.sourceContext);
index 41bc6a66a9dd43e6caecdb09039b6e2eafb9bcc4..e93db655aef665f12f49abb45948e19fb3b30c25 100644 (file)
@@ -564,7 +564,7 @@ public class ReferenceType extends ResolvedType {
                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;
        }
@@ -579,7 +579,7 @@ public class ReferenceType extends ResolvedType {
                        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 {
index e7aff6ea3a4865d687ee0f88356c4d6ea837386f..fbe738eebda172316f164fe8de31523da535a889 100644 (file)
@@ -141,7 +141,7 @@ public class ResolvedPointcutDefinition extends ResolvedMemberImpl {
                                        getName(),
                                        parameterizedParameterTypes,
                                        parameterizedReturnType,
-                                       pointcut.parameterizeWith(typeMap)
+                                       pointcut.parameterizeWith(typeMap,newDeclaringType.getWorld())
                                );
                ret.setTypeVariables(getTypeVariables());
                ret.setSourceContext(getSourceContext());
index b80992f71e46c2088f0c817671859c2169cb31c4..a9e52a14a5252902c7da293eec1c073843f4eeb3 100644 (file)
@@ -1855,10 +1855,11 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
         * 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;
                        }
                }
@@ -1872,6 +1873,10 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl
                                        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());
index 13026970a838c7a3e767acfa6b07dd2f551aa2c0..d85d7412daa384966d91cbc9232be9b0495a3ad5 100644 (file)
@@ -376,4 +376,11 @@ public class TypeVariable {
                TypeVariable newVariable = new TypeVariable(name,ubound,ibounds);
                return newVariable;             
     }
+
+       public String getGenericSignature() {
+               return "T"+name+";";
+       }
+       public String getErasureSignature() {
+               return getFirstBound().getErasureSignature();
+       }
 }
index e35ff5c862c6a171a330329288f72b8804e0f0e8..4f6e8234b27397e990d920b20b14ab7b12a0ca55 100644 (file)
@@ -13,6 +13,7 @@ package org.aspectj.weaver;
 
 import java.io.DataOutputStream;
 import java.io.IOException;
+import java.util.Map;
 
 /**
  * Represents a type variable in a type or generic method declaration
@@ -31,8 +32,9 @@ public class TypeVariableReferenceType extends BoundedReferenceType implements T
        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;
@@ -65,6 +67,12 @@ public class TypeVariableReferenceType extends BoundedReferenceType implements T
                        }
                }
        }
+
+       public UnresolvedType parameterize(Map typeBindings) {
+               UnresolvedType ut = (UnresolvedType) typeBindings.get(getName());
+               if (ut!=null) return ut;
+               return this;
+       }
        
        public ReferenceType[] getAdditionalBounds() {
                if (!resolvedIfBounds) {
index c9fabc205fbf4408097f680ee80d7891c258e26f..52483b472bfc4637da8366252738d1adf0ec3439 100644 (file)
@@ -101,7 +101,7 @@ public class BcelAdvice extends Advice {
        }
        
        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;             
index b1c998ed8529beea64cf8ff702f73900d944c514..0a392cc26874e1f9b915db19816c126a8c099806 100644 (file)
@@ -153,8 +153,8 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
             } 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(),
index 63a7139e8aef88ffe9cadf6fe832c5994cec9772..04b1554eba4aa4e36ac8ddc140e30b81e127c4c2 100644 (file)
@@ -19,6 +19,7 @@ import org.aspectj.util.FuzzyBoolean;
 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;
@@ -133,7 +134,7 @@ public class PointcutDesignatorHandlerBasedPointcut extends Pointcut{
        /* (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;
        }
 
index 0193b44d632d0dc09e2d2298123579710bf8dad2..f55f36d71def05f51bd3442c5b528ce22fb5fa15 100644 (file)
@@ -55,9 +55,9 @@ public class AndAnnotationTypePattern extends AnnotationTypePattern {
                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;
index 4fecf8f54546138f838dd5ed63b6e0709712779e..58608a7936621e429b5d2d3d1f585b045d1fd309 100644 (file)
@@ -23,6 +23,7 @@ import org.aspectj.weaver.IntMap;
 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 {
@@ -100,9 +101,9 @@ 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;
        }
index 3d704cf76c67e703982ebafc4dff30603e91fc20..8c45988e6819103e7b9bb8f5a47b909a021ffd08 100644 (file)
@@ -21,6 +21,7 @@ import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
 
 /**
  * left && right
@@ -107,9 +108,9 @@ public class AndTypePattern extends TypePattern {
                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;
index 0f3f98122555702894489b4aaf152abcb9045419..f423eb350dd50c82a600f2a00f0948eda3b354f1 100644 (file)
@@ -58,10 +58,10 @@ public class AnnotationPatternList extends PatternNode {
                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);
index d1541afe90abaa4852066936e0c67f18a8c38fc5..7a516754fb78dfaa94b3b6fe0c2f4a4f8898fa14 100644 (file)
@@ -34,6 +34,7 @@ import org.aspectj.weaver.ShadowMunger;
 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;
@@ -86,8 +87,8 @@ public class AnnotationPointcut extends NameBindingPointcut {
                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;
        }
index ea6626fdc0a98adbab7d65eb8ee7f971576e3e9d..78a2b10425649f30c13da50c3dc8b7ec66e7b690 100644 (file)
@@ -46,7 +46,7 @@ public abstract class AnnotationTypePattern extends PatternNode {
        
        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; }
        
@@ -111,7 +111,7 @@ class AnyAnnotationTypePattern extends AnnotationTypePattern {
     
     public boolean isAny() { return true; }
     
-    public AnnotationTypePattern parameterizeWith(Map arg0) {
+    public AnnotationTypePattern parameterizeWith(Map arg0,World w) {
        return this;
     }
 }
@@ -135,7 +135,7 @@ class EllipsisAnnotationTypePattern extends AnnotationTypePattern {
         return visitor.visit(this, data);
     }
     
-    public AnnotationTypePattern parameterizeWith(Map arg0) {
+    public AnnotationTypePattern parameterizeWith(Map arg0,World w) {
        return this;
     }
     
index b83a0544b06c0f1d5d18e7ecf181cb084fafc62b..5c749cabd8ca7030696315b6253911ab3b936c5e 100644 (file)
@@ -27,6 +27,7 @@ import org.aspectj.weaver.Shadow;
 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;
@@ -60,8 +61,8 @@ public class ArgsAnnotationPointcut extends NameBindingPointcut {
                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;
        }
index a5d17eed62519724e79ca1ad2a163f4dc091a04c..67cfc41ef9800a671bc255fa218a03fe14660baf 100644 (file)
@@ -58,8 +58,8 @@ public class ArgsPointcut extends NameBindingPointcut {
         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;
     }
index 6cf54a33f20ec0bcb9028c7df6bce2a0adb45d5b..adecd08dfbff36424ea5eca1972a08e6e084d41d 100644 (file)
@@ -69,7 +69,7 @@ public class BindingAnnotationTypePattern extends ExactAnnotationTypePattern imp
                }
        }
        
-       public AnnotationTypePattern parameterizeWith(Map typeVariableMap) {
+       public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) {
                UnresolvedType newAnnotationType = annotationType;
                if (annotationType.isTypeVariableReference()) {
                        TypeVariableReference t = (TypeVariableReference) annotationType;
index 3c4ded9bd6995cb7ac03944021f31a490e2ee8c5..28c5739adfc9103e36a7a4607adc394110905bcb 100644 (file)
@@ -22,6 +22,7 @@ import org.aspectj.weaver.ISourceContext;
 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;
@@ -82,8 +83,8 @@ public class BindingTypePattern extends ExactTypePattern implements BindingPatte
                }
        }
        
-       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;
index ac8f35e6bf1bb6553e1baf9a106fadef608407ee..1229cd473ed2c654b994d68f7ca3b6d4472c2fc9 100644 (file)
@@ -110,8 +110,8 @@ public class CflowPointcut extends Pointcut {
                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;
        }
index 1053dbe8277473efb1c6717576c97777dccb9024..a5a8339176974a22eea876e8b1dcfb932e7279f6 100644 (file)
@@ -30,6 +30,7 @@ import org.aspectj.weaver.ResolvedType;
 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;
@@ -98,7 +99,7 @@ public class ConcreteCflowPointcut extends Pointcut {
                throw new RuntimeException("unimplemented");
        }
        
-       public Pointcut parameterizeWith(Map typeVariableMap) {
+       public Pointcut parameterizeWith(Map typeVariableMap,World w) {
                throw new RuntimeException("unimplemented");
        }
        
index c8d92bcf8eece5c1939d70fbc17cdf27c41f3720..174001047006658443b3d663aa3f7995d3a5ad3c 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 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;
@@ -57,7 +58,7 @@ public abstract class Declare extends PatternNode {
      * 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
index eb674c58a56affeeaeeef4110cc2a65e780f344f..e1ecb777cc46e5ea6dac5c30d96c613e52ef6b42 100644 (file)
@@ -127,12 +127,12 @@ public class DeclareAnnotation extends Declare {
                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;
index c9b6637284be58b19c76d8a62813c7e6cd0104c8..c8922933b05c0c978ff0d75dcedf1a5a7e6825fe 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Map;
 
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
 
 public class DeclareErrorOrWarning extends Declare {
        private boolean isError;
@@ -101,8 +102,8 @@ public class DeclareErrorOrWarning extends Declare {
        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;
     }
index 2a7baea264387962c2f0e8242118a44585cd37a1..414e1d8ba5c148d287eb5783044fd164f909fbb4 100644 (file)
@@ -73,11 +73,11 @@ public class DeclareParents extends Declare {
                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;
index 2415060e9b6980304c75f791ca7b6137440416f3..810f5ed919afdc87cddb158be55ab69a42edd1c6 100644 (file)
@@ -23,6 +23,7 @@ import org.aspectj.weaver.ISourceContext;
 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;
@@ -40,8 +41,8 @@ public class DeclarePrecedence extends Declare {
                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;
        }
index a5011a5b82e117ebad39d3361c4e2c3d6730f75d..ed6a783757cbe75d1b2187c7ba3c6a4a9fe79223 100644 (file)
@@ -23,6 +23,7 @@ import org.aspectj.weaver.ResolvedType;
 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;
@@ -37,11 +38,11 @@ public class DeclareSoft extends Declare {
                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;
        }
index a49f7d5c8fe12d13d953865a39656f2636e12e1e..9f2a98a49f708819a705f17d64d893dfd3af9449 100644 (file)
@@ -168,7 +168,7 @@ public class ExactAnnotationTypePattern extends AnnotationTypePattern {
                return this;
        }
        
-       public AnnotationTypePattern parameterizeWith(Map typeVariableMap) {
+       public AnnotationTypePattern parameterizeWith(Map typeVariableMap,World w) {
                UnresolvedType newAnnotationType = annotationType;
                if (annotationType.isTypeVariableReference()) {
                        TypeVariableReference t = (TypeVariableReference) annotationType;
index 79397d206fd4acbe2cf59c88eb74976479638ad7..39c3877a01b1d04f985300e3d82a9af1657dad4f 100644 (file)
@@ -28,6 +28,7 @@ import org.aspectj.weaver.TypeVariableReference;
 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;
@@ -232,7 +233,7 @@ public class ExactTypePattern extends TypePattern {
         * 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;
@@ -241,10 +242,10 @@ public class ExactTypePattern extends TypePattern {
                                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;
        }
index b399391128865c3cc66999cd5452f64d3014bd0a..b26dc9bb7488f8564f2a7bcc339372fefccead4c 100644 (file)
@@ -26,6 +26,7 @@ import org.aspectj.weaver.Shadow;
 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;
 
@@ -65,8 +66,8 @@ public class HandlerPointcut extends Pointcut {
                                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;
        }
index 9c966e6c7075049936783dbeee5b86821db424c8..263b7888fb9fd8eb7ef897e672f33bd0ad155e2a 100644 (file)
@@ -102,8 +102,8 @@ public class HasMemberTypePattern extends TypePattern {
                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;
        }
index f2615a1cf0866adac96f21155898a14c7bead997..304c26056a8873273b6558ce983589a593541582 100644 (file)
@@ -35,6 +35,7 @@ import org.aspectj.weaver.ShadowMunger;
 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;
@@ -368,7 +369,7 @@ public class IfPointcut extends Pointcut {
        }
 
        // we can't touch "if" methods
-       public Pointcut parameterizeWith(Map typeVariableMap) {
+       public Pointcut parameterizeWith(Map typeVariableMap,World w) {
                return this;
        }
        
index cc2064742e4aafa955e8586cc003b0f92a166af9..2d68d17b846fa7723b785e80066b0ac63309b44b 100644 (file)
@@ -377,8 +377,8 @@ public class KindedPointcut extends Pointcut {
         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;
        }
index 83a0fb588f92ee6a88039b82c85861b600343310..cd8cb342065bacaf00a1c02daf9ca3f6c41e4cd6 100644 (file)
@@ -52,8 +52,8 @@ public class NotAnnotationTypePattern extends AnnotationTypePattern {
        }
 
        
-       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;
index f5fcede37688698f14dd70677bce1c8e596b30e8..297522b124c2faca0029f5974706c54e1a4f9154 100644 (file)
@@ -23,6 +23,7 @@ import org.aspectj.weaver.IntMap;
 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 {
@@ -102,8 +103,8 @@ 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;
        }
index 6841c708857846868dc3443fde4035213c33b7bf..5ade60e450b1b897a9c6ec3512fbff223b7c63eb 100644 (file)
@@ -22,6 +22,7 @@ import org.aspectj.weaver.AjAttribute;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
 
 /**
  * !TypePattern
@@ -103,8 +104,8 @@ public class NotTypePattern extends 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;
index 886213c644453816130ba464bf646dcd5c8293fe..fe95053c4517f23f670778802762c36b3ac50de4 100644 (file)
@@ -49,9 +49,9 @@ public class OrAnnotationTypePattern extends AnnotationTypePattern {
                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;
index 4562b266ce9a14bd4b30966d9f17ea893f1ba498..01637f3b64c316cc8d105217b1321a5eec14ca2b 100644 (file)
@@ -23,6 +23,7 @@ import org.aspectj.weaver.IntMap;
 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 {
@@ -103,9 +104,9 @@ 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;
        }
index 63a0521f3e9ebb0f5020b29c8cd5b9936dc70514..b5011cc5e5011cca0b58f147d9c2a7b022be569f 100644 (file)
@@ -21,6 +21,7 @@ import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.ResolvedType;
 import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.World;
 
 /**
  * left || right
@@ -120,9 +121,9 @@ public class OrTypePattern extends TypePattern {
                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;
index deb7419f1000b57d95ce4f1d70de7a644288dffb..a8395fa2a0c4f5ea377b4c2d2ac09d747569c5b2 100644 (file)
@@ -70,8 +70,8 @@ public class PerCflow extends PerClause {
        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;
     }
index cfe742ac78b83672530c93608aaac19b66b8fdb6..13c81fe93dac7b5eb4ecd2e1c9b5dffade3f38da 100644 (file)
@@ -24,6 +24,7 @@ import org.aspectj.weaver.ResolvedType;
 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 {
@@ -76,7 +77,7 @@ public class PerFromSuper extends PerClause {
         }
        }
        
-       public Pointcut parameterizeWith(Map typeVariableMap) {
+       public Pointcut parameterizeWith(Map typeVariableMap,World w) {
                return this;
        }
        
index 7ed45392bd2c0c2c0c009f64873d85a6b1f69e7b..c229734929ed3994d021e84e2fe83e68a6864cbb 100644 (file)
@@ -81,8 +81,8 @@ public class PerObject extends PerClause {
        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;
     }
index 3852b6a7ad9e96087d3f5102be8c00b7d1275194..f2d6d39c67f722481b861a3d9924bf73e43506f7 100644 (file)
@@ -23,6 +23,7 @@ import org.aspectj.weaver.ISourceContext;
 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;
@@ -52,7 +53,7 @@ public class PerSingleton extends PerClause {
        // this method intentionally left blank
     }
 
-    public Pointcut parameterizeWith(Map typeVariableMap) {
+    public Pointcut parameterizeWith(Map typeVariableMap,World w) {
        return this;
     }
     
index a824a05453bb90dc0f9d06bcf970705777ec9dd7..ee47eacc89616f5e9cb528a2febbbfe1f74f9857 100644 (file)
@@ -60,8 +60,8 @@ public class PerTypeWithin extends PerClause {
                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;
        }
index 2f4e583ec373bd21b0a061d8b34675dbfab53e1c..424d623f4b17e100ca7675c8948d944dc8ab26b3 100644 (file)
@@ -371,7 +371,7 @@ public abstract class Pointcut extends PatternNode {
             return visitor.visit(this, data);
         }
         
-        public Pointcut parameterizeWith(Map typeVariableMap) {
+        public Pointcut parameterizeWith(Map typeVariableMap,World w) {
                return this;
         }
        }
@@ -391,6 +391,6 @@ public abstract class Pointcut extends PatternNode {
                }
        }
        
-       public abstract Pointcut parameterizeWith(Map typeVariableMap);
+       public abstract Pointcut parameterizeWith(Map typeVariableMap,World w);
 
 }
index 2dcdf61f4bb17c1d6d35ce868636c12399fdb251..7b49ae36d24319800174902755e262fa50756dac 100644 (file)
@@ -33,6 +33,7 @@ import org.aspectj.weaver.TypeVariableReference;
 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;
 
 /**
@@ -219,7 +220,7 @@ public class ReferencePointcut extends Pointcut {
                        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,
@@ -355,7 +356,7 @@ public class ReferencePointcut extends Pointcut {
                        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);
@@ -373,7 +374,7 @@ public class ReferencePointcut extends Pointcut {
         * 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;
index fc8f448c3b41734849e81244299b72d92ea61a35..b31287e77ce24d5e4fe75b516fbee5c917af7c3c 100644 (file)
@@ -261,16 +261,16 @@ public class SignaturePattern extends PatternNode {
         * 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;
        }
index a234c107b05234f86f69f04d2c744ecad2728182..4285a411c39e129d82ac07760d71e3c9c5db8435 100644 (file)
@@ -27,6 +27,7 @@ import org.aspectj.weaver.ShadowMunger;
 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;
@@ -84,12 +85,12 @@ public class ThisOrTargetAnnotationPointcut extends NameBindingPointcut {
                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;
        }
index bc9d40ae2db130bf048b0f9106d38c5691048ee3..17398377b0b7e133db6fd2b99f80f4e6bb77cb30 100644 (file)
@@ -30,6 +30,7 @@ import org.aspectj.weaver.Shadow;
 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;
@@ -86,8 +87,8 @@ public class ThisOrTargetPointcut extends NameBindingPointcut {
 
        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;
        }
index eedefc27cb1f9a5cf8754fb2b72a92a673597ba2..04dd0c264d06e7f3a9c4dfe225419b514f16c79f 100644 (file)
@@ -76,10 +76,10 @@ public class ThrowsPattern extends PatternNode {
        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;
     }
index 45de16f488edc7649c57394e4c1e4c70e1bc6f7f..49eb0c314ebbfa86ef58774ec219a3ba7b05a730 100644 (file)
@@ -229,7 +229,7 @@ public abstract class TypePattern extends PatternNode {
      * 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) {
        }
@@ -360,7 +360,7 @@ class EllipsisTypePattern extends TypePattern {
         return visitor.visit(this, data);
     }
     
-    public TypePattern parameterizeWith(Map typeVariableMap) {
+    public TypePattern parameterizeWith(Map typeVariableMap,World w) {
        return this;
     }
 
@@ -441,7 +441,7 @@ class AnyTypePattern extends TypePattern {
         return visitor.visit(this, data);
     }
     
-    public TypePattern parameterizeWith(Map arg0) {
+    public TypePattern parameterizeWith(Map arg0,World w) {
        return this;
     }
 }
@@ -482,8 +482,8 @@ class AnyWithAnnotationTypePattern extends TypePattern {
                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;
        }
@@ -603,7 +603,7 @@ class NoTypePattern extends TypePattern {
         return visitor.visit(this, data);
     }
     
-    public TypePattern parameterizeWith(Map arg0) {
+    public TypePattern parameterizeWith(Map arg0,World w) {
        return this;
     }
 }
index 35864aeeb13d8e358c05a6c9a8145dea1a48ed9b..aec01ed74ae6bca81bc1e82023ff2ab54ff0ee50 100644 (file)
@@ -26,6 +26,7 @@ import org.aspectj.weaver.IntMap;
 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;
@@ -189,10 +190,10 @@ public class TypePatternList extends PatternNode {
      * @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);
     }
index 7a3bb3ce6911f072ebb9f5fe6838b1b0aa7fc097..35c18bc3dd5808db847eb081c3838c6c1029aa72 100644 (file)
@@ -108,8 +108,8 @@ public class WildAnnotationTypePattern extends AnnotationTypePattern {
        }
     }
     
-    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;
index 323583652e748a106e04596b332bdc6dcf8d2f72..69a67ba4b2f4eadae6c667a620532cd6d65ab875 100644 (file)
@@ -536,7 +536,7 @@ public class WildTypePattern extends TypePattern {
                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) {
@@ -558,19 +558,19 @@ public class WildTypePattern extends TypePattern {
                                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;
index 6b01b39bb4eb153304111e53469f8d0ab3ddab1a..edda22658f26c396d38b785b109298f7f1444bd7 100644 (file)
@@ -28,6 +28,7 @@ import org.aspectj.weaver.ShadowMunger;
 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;
@@ -68,8 +69,8 @@ public class WithinAnnotationPointcut extends NameBindingPointcut {
                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;
        }
index 8bc2439a56d7b2da1187568ce217106018e77be2..74cb2a6203f1e0d43ff34c4aa1830d1ce7c1bcac 100644 (file)
@@ -31,6 +31,7 @@ import org.aspectj.weaver.ShadowMunger;
 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;
@@ -78,8 +79,8 @@ public class WithinCodeAnnotationPointcut extends NameBindingPointcut {
                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;
        }
index 94737fe7072cb29ac59cf2c466cbfa2f8212b068..aaab8355bc3673c6ce87d641b0d99240cffe4d4d 100644 (file)
@@ -26,6 +26,7 @@ import org.aspectj.weaver.ResolvedType;
 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;
 
@@ -55,8 +56,8 @@ public class WithinPointcut extends Pointcut {
                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;
        }
index dd0f71136e437fa02c906991a6fc4bac5c3a5423..91beeb87c78034098afd8367ece2eb44bff7a736 100644 (file)
@@ -25,6 +25,7 @@ import org.aspectj.weaver.ResolvedType;
 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;
 
@@ -56,8 +57,8 @@ public class WithincodePointcut extends Pointcut {
                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;
        }