diff options
author | aclement <aclement> | 2005-01-31 14:02:38 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-01-31 14:02:38 +0000 |
commit | 94251be73e24166f25ee2d8ca477879fea53dfa2 (patch) | |
tree | b3196b3592a1391870ba77e2f3893eb611f3a98e /tests/java5 | |
parent | 51aedc9a20c3c571f01bbfd79ca357759e008479 (diff) | |
download | aspectj-94251be73e24166f25ee2d8ca477879fea53dfa2.tar.gz aspectj-94251be73e24166f25ee2d8ca477879fea53dfa2.zip |
Tests for static method call/execution with @annotation
Diffstat (limited to 'tests/java5')
-rw-r--r-- | tests/java5/annotations/binding/StaticMethods.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/java5/annotations/binding/StaticMethods.java b/tests/java5/annotations/binding/StaticMethods.java new file mode 100644 index 000000000..385ea70c8 --- /dev/null +++ b/tests/java5/annotations/binding/StaticMethods.java @@ -0,0 +1,28 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Colored {String value();} + + +public class StaticMethods { + + public static void main(String[] argv) { + m1(); + m2(); + } + + + @Colored("red") static void m1() {System.err.println("m1 running");} + @Colored("blue") static void m2() {System.err.println("m2 running");} + + static aspect X { + before(Colored c): call(* m*(..)) && @annotation(c) { + System.err.println("Color at "+thisJoinPoint+" is "+c.value()); + } + before(Colored c): execution(* m*(..)) && @annotation(c) { + System.err.println("Color at "+thisJoinPoint+" is "+c.value()); + } + } + +} + |