aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/InterfaceInitializerOrder.java26
-rw-r--r--tests/bugs/SubtypeConstructorCW.java4
2 files changed, 28 insertions, 2 deletions
diff --git a/tests/bugs/InterfaceInitializerOrder.java b/tests/bugs/InterfaceInitializerOrder.java
new file mode 100644
index 000000000..3036bcac9
--- /dev/null
+++ b/tests/bugs/InterfaceInitializerOrder.java
@@ -0,0 +1,26 @@
+import org.aspectj.testing.Tester;
+
+public class InterfaceInitializerOrder {
+ public static void main(String[] args) {
+ Base base = new Base();
+ Tester.checkEqual(InitAspect.inits.toString(), "Super1,Super2,SuperInterface,Base,");
+ }
+}
+
+class Super1 {}
+
+class Super2 extends Super1 {}
+
+interface SuperInterface {}
+
+class Base extends Super2 implements SuperInterface { }
+
+aspect InitAspect {
+ public static StringBuffer inits = new StringBuffer();
+
+ pointcut outerMatch() : initialization(new(..)) && !within(InitAspect);
+ before() : outerMatch() {
+ inits.append(thisJoinPoint.getSignature().getDeclaringType().getName());
+ inits.append(",");
+ }
+}
diff --git a/tests/bugs/SubtypeConstructorCW.java b/tests/bugs/SubtypeConstructorCW.java
index d3b6a8765..f37ac8b37 100644
--- a/tests/bugs/SubtypeConstructorCW.java
+++ b/tests/bugs/SubtypeConstructorCW.java
@@ -7,8 +7,8 @@ class C implements Runnable { // CW 5
}
}
class F implements Runnable {
- F(int i) {// CW 10
- }
+ F(int i) {}// CW 10
+
public void run() {
}
}