summaryrefslogtreecommitdiffstats
path: root/tests/bugs164/pr265695/AspNew.aj
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs164/pr265695/AspNew.aj')
-rw-r--r--tests/bugs164/pr265695/AspNew.aj32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/bugs164/pr265695/AspNew.aj b/tests/bugs164/pr265695/AspNew.aj
new file mode 100644
index 000000000..ae99590fb
--- /dev/null
+++ b/tests/bugs164/pr265695/AspNew.aj
@@ -0,0 +1,32 @@
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Secured {
+ String value();
+}
+
+interface DemoService {
+ @Secured("READ")
+ void secureMethod();
+}
+
+
+class DemoServiceImpl implements DemoService {
+ public void secureMethod() { }
+}
+
+aspect X {
+ // None of these match, the subject at execution(secureMethod()) does not have the annotation
+ // see http://www.eclipse.org/aspectj/doc/next/adk15notebook/join-point-modifiers.html
+ before(): execution(@Secured! * *Service+.*(..)) { }
+
+
+}
+
+public class AspNew {
+ public static void main(String[] args) {
+ new DemoServiceImpl().secureMethod();
+ }
+}
+