]> source.dussan.org Git - aspectj.git/commitdiff
@testcase PR#36778 advise join points in subclass of empty interface
authorwisberg <wisberg>
Tue, 22 Apr 2003 23:13:18 +0000 (23:13 +0000)
committerwisberg <wisberg>
Tue, 22 Apr 2003 23:13:18 +0000 (23:13 +0000)
tests/ajcTestsFailing.xml
tests/new/EmptyInterface.java [new file with mode: 0644]

index cb741c1e06e224218dbbdf2f4da77f36dff43413..ec15b0ad8ab9d7b1760f43429fd4738eda10abc8 100644 (file)
@@ -4,5 +4,11 @@
 <!-- contains valid tests that the compiler has never passed -->
 <suite>
 
+    <ajc-test dir="new" pr="36778"
+      title="advise join points in subclass of empty interface">
+        <compile files="EmptyInterface.java"/>
+        <run class="EmptyInterface"/>
+    </ajc-test>
+
 
 </suite>
diff --git a/tests/new/EmptyInterface.java b/tests/new/EmptyInterface.java
new file mode 100644 (file)
index 0000000..db53d59
--- /dev/null
@@ -0,0 +1,33 @@
+
+
+import org.aspectj.testing.Tester;
+
+/** @testcase PR#36778 advise join points in subclass of empty interface */
+public class EmptyInterface {
+
+    public static void main(String[] args) {
+        new C().go();
+        // at least constructor and method execution
+        if (2 > Log.hits) {
+            Tester.check(false, Log.log.toString());
+        }
+    }
+}
+
+aspect Log {
+    static int hits;
+    static StringBuffer log = new StringBuffer();
+    interface LoggedType {}
+    declare parents: C implements LoggedType;
+    void around() : within(LoggedType+) 
+        && !initialization(new(..))
+        && !preinitialization(new(..)) // 1.1 only  
+        {
+        hits++;
+        log.append(thisJoinPoint + ";");
+    }
+}
+
+class C {
+    void go() {}
+}