diff options
Diffstat (limited to 'tests/bugs/InterfaceInitializerOrder.java')
-rw-r--r-- | tests/bugs/InterfaceInitializerOrder.java | 26 |
1 files changed, 26 insertions, 0 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(","); + } +} |