From d5a63db3a0bfca32ef54e82685179894db10c327 Mon Sep 17 00:00:00 2001 From: wisberg Date: Mon, 28 Jul 2003 22:38:47 +0000 Subject: [PATCH] @testcase PR#40876 subtype-qualified pointcut reference (ClassFormatError) --- tests/ajcTestsFailing.xml | 8 +++++ tests/bugs/PointcutLibraryTest.java | 50 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 tests/bugs/PointcutLibraryTest.java diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index 2fb358054..0f5af6454 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -4,6 +4,13 @@ + + + + + + diff --git a/tests/bugs/PointcutLibraryTest.java b/tests/bugs/PointcutLibraryTest.java new file mode 100644 index 000000000..17ce36b52 --- /dev/null +++ b/tests/bugs/PointcutLibraryTest.java @@ -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); + } +} -- 2.39.5