diff options
author | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
commit | 144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch) | |
tree | b12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/CallsAndLocalClasses.java | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/new/CallsAndLocalClasses.java')
-rw-r--r-- | tests/new/CallsAndLocalClasses.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/new/CallsAndLocalClasses.java b/tests/new/CallsAndLocalClasses.java new file mode 100644 index 000000000..f807605b1 --- /dev/null +++ b/tests/new/CallsAndLocalClasses.java @@ -0,0 +1,47 @@ +import org.aspectj.testing.Tester; + +public class CallsAndLocalClasses { + public static void main(String[] args) { + Runnable r = new Outer().makeRunnable(); + r.run(); + + Outer o = new Outer(); + o.toString(); + ((Comparable)o).toString(); + + Tester.check("run from Outer"); + Tester.check("m"); + Tester.check("before run"); + Tester.check("before m"); + } +} + + +class Outer implements Comparable { + public int compareTo(Object other) { Tester.note("m"); return 0; } + + public Runnable makeRunnable() { + return new Runnable() { + public void run() { + Tester.note("run from Outer"); + compareTo(this); + } + }; + } +} + +final class Foo { + public String toString() { return "Foo"; } +} + +aspect A { + before(): call(void Runnable.run()) { + Tester.note("before run"); + } + before(): call(int compareTo(Object)) { + Tester.note("before m"); + } + before(): call(String Object.toString()) { + System.out.println("before toString"); + } +} |