diff options
Diffstat (limited to 'tests/new/staticMethAdv/Driver.java')
-rw-r--r-- | tests/new/staticMethAdv/Driver.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/new/staticMethAdv/Driver.java b/tests/new/staticMethAdv/Driver.java new file mode 100644 index 000000000..9946c0f07 --- /dev/null +++ b/tests/new/staticMethAdv/Driver.java @@ -0,0 +1,29 @@ + +import org.aspectj.testing.Tester; + +// PR#151 + +public class Driver { + public static void main(String[] args) { test(); } + public static void test() { + Tester.checkEqual(C.set(), "C-advised-set", ""); + } + + static advice(C c): c && * *(..) { + before { + if (c != null) + Tester.check(false, "c == null"); + else + c.s += "-advised"; + } + } +} + +class C { + static String s = "C"; + + static String set() { + s += "-set"; + return s; + } +} |