]> source.dussan.org Git - aspectj.git/commitdiff
tests for 156058 and 159983
authoraclement <aclement>
Fri, 6 Oct 2006 15:43:34 +0000 (15:43 +0000)
committeraclement <aclement>
Fri, 6 Oct 2006 15:43:34 +0000 (15:43 +0000)
tests/bugs153/pr156058/Bug2.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml

diff --git a/tests/bugs153/pr156058/Bug2.java b/tests/bugs153/pr156058/Bug2.java
new file mode 100644 (file)
index 0000000..229e785
--- /dev/null
@@ -0,0 +1,25 @@
+aspect MyAspect implements MyInterface<MyClass> {
+  before() : MyAspect1<MyClass>.myPointcutInInterface(){ }
+}
+
+class MyClass {}
+
+interface MyInterface<T>{
+  public abstract static aspect MyAspect1<T> {
+    public final pointcut myPointcutInInterface() : call(T *(..));
+  }
+}
+
+public class Bug2 {
+  public static void main(MyClass[]argv) {
+    new Bug2().callit();
+  }
+
+  public MyClass callit() {
+    return null;
+  }
+}
+
+aspect MyAspect2 implements MyInterface<String> {
+       before(): MyAspect1<String>.myPointcutInInterface() {} // shouldn't match...  since the return type of callit is MyClass
+}
\ No newline at end of file
index 3aa129227dd4897539c478aea3ee13ee8a417d8a..e1838f627c275aec476f0bfc13a16034f413d472 100644 (file)
@@ -27,8 +27,9 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   // public void testArgnamesAndJavac_pr148381() { runTest("argNames and javac");}
   // public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); }
   // public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");}
-//  public void testNoIllegalStateExceptionWithGenericInnerAspect_pr156058() { runTest("no IllegalStateException with generic inner aspect"); }
 //  public void testNegatedAnnotationMatchingProblem_pr153464() { runTest("negated annotation matching problem");}
+  public void testNoIllegalStateExceptionWithGenericInnerAspect_pr156058() { runTest("no IllegalStateException with generic inner aspect"); }
+  public void testNoIllegalStateExceptionWithGenericInnerAspect_pr156058_2() { runTest("no IllegalStateException with generic inner aspect - 2"); }
   public void testDeclareMethodAnnotations_pr159143() { runTest("declare method annotations");}
   public void testVisibilityProblem_pr149071()                 { runTest("visibility problem");}
   public void testMissingLineNumbersInStacktraceAfter_pr145442() { runTest("missing line numbers in stacktrace after");}
index 7e3f4e88885044923072e3221defc284b00bc4bc..a6ddc8ec834a63ec8a15089e845da67079c535e1 100644 (file)
       </compile>
     </ajc-test>
     
+    <ajc-test dir="bugs153/pr156058" title="no IllegalStateException with generic inner aspect - 2">
+      <compile files="Bug2.java" options="-1.5 -showWeaveInfo">
+        <message kind="weave" text="Join point 'method-call(MyClass Bug2.callit())' in Type 'Bug2' (Bug2.java:15) advised by before advice from 'MyAspect' (Bug2.java:2)"/>
+        <message kind="warning" line="24" text="advice defined in MyAspect2 has not been applied [Xlint:adviceDidNotMatch]"/>
+      </compile>
+    </ajc-test>
+    
     <ajc-test dir="bugs153/pr153490" title="no illegal state exception from AsmDelegate - 1">
       <compile files="Foo.java" options="-1.5" classpath="jarForFoo.jar" />
     </ajc-test>