diff options
Diffstat (limited to 'tests/bugs152/pr138223/DoubleAnnotationMatching.aj')
-rw-r--r-- | tests/bugs152/pr138223/DoubleAnnotationMatching.aj | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/bugs152/pr138223/DoubleAnnotationMatching.aj b/tests/bugs152/pr138223/DoubleAnnotationMatching.aj new file mode 100644 index 000000000..415309421 --- /dev/null +++ b/tests/bugs152/pr138223/DoubleAnnotationMatching.aj @@ -0,0 +1,33 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@interface Tx { + boolean readOnly() default false; +} + +public aspect DoubleAnnotationMatching { + + + pointcut methodInTxType(Tx tx) : + execution(* *(..)) && @this(tx) && if(tx.readOnly()); + + pointcut txMethod(Tx tx) : + execution(* *(..)) && @annotation(tx) && if(tx.readOnly()); + + pointcut transactionalOperation() : + methodInTxType(Tx) || txMethod(Tx); + + before() : transactionalOperation() { + // do something + } + +} + +@Tx class Foo { + + public void foo() {} + + @Tx public void bar() {} + + +}
\ No newline at end of file |