]> source.dussan.org Git - aspectj.git/commitdiff
@testcase PR#40876 subtype-qualified pointcut reference
authorwisberg <wisberg>
Mon, 28 Jul 2003 22:38:47 +0000 (22:38 +0000)
committerwisberg <wisberg>
Mon, 28 Jul 2003 22:38:47 +0000 (22:38 +0000)
(ClassFormatError)

tests/ajcTestsFailing.xml
tests/bugs/PointcutLibraryTest.java [new file with mode: 0644]

index 2fb35805454467551243af17f1ad05ac0c9feb59..0f5af64542074d58906a310283a12e96c7529654 100644 (file)
@@ -4,6 +4,13 @@
 <!-- contains valid tests that the compiler has never passed -->
 
 <suite>
+       <ajc-test dir="bugs"
+               pr="40876"
+               title="subtype-qualified pointcut reference">
+               <compile files="PointcutLibraryTest.java"/>
+               <run class="PointcutLibraryTest"/>
+               </ajc-test>
+
        <ajc-test dir="bugs"
                pr="40858"
                comment="shouldn't super ref be permitted?"
@@ -38,4 +45,5 @@
                        <message kind="warning" line="38" text="call ICanGetSomething.getSomething"/>
                        </compile>
                </ajc-test>
+
 </suite>
diff --git a/tests/bugs/PointcutLibraryTest.java b/tests/bugs/PointcutLibraryTest.java
new file mode 100644 (file)
index 0000000..17ce36b
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * This test case produces a ClassFormatError under 1.1.0, but
+ * the code is not set up to run/test correctly
+ * after the bug is fixed.
+ */
+
+/** @testcase PR#40876 subtype-qualified pointcut reference */
+public class PointcutLibraryTest {
+    public static void main(String[] a) {
+        new Test().run();
+    }
+}
+
+class Test {
+    public void run(){ prun(); }
+    private void prun() {
+        System.out.println("Test.prun()");
+    }
+}
+
+/** private default implementation of library */
+class PrivatePointcutLibrary {
+    pointcut adviceCflow() : !cflow(adviceexecution());
+    pointcut publicCalls() : call(public * *(..))
+        && !adviceCflow();
+}
+
+/** public interface for library */
+class PointcutLibrary extends PrivatePointcutLibrary {
+}
+
+// ---- different clients of the library
+
+/** use library by inheriting scope in class */
+class CPL extends PointcutLibrary {
+    static aspect A {
+        before() : publicCalls() {
+            System.out.println("CPL: " 
+                + thisJoinPointStaticPart);
+        }
+    }
+}
+
+/** client by external reference to CPL */
+aspect ExternalClientOfCPL {
+    before() : CPL.publicCalls() { // remove this to avoid bug?
+        System.out.println("XDP: " 
+            + thisJoinPointStaticPart);
+    }
+}