summaryrefslogtreecommitdiffstats
path: root/tests/bugs152
diff options
context:
space:
mode:
authoraclement <aclement>2006-06-26 07:31:36 +0000
committeraclement <aclement>2006-06-26 07:31:36 +0000
commitc8e1c4e4ef296b9108af8036f30baad4443b5afe (patch)
tree1c1f12011e4f9dc25262ac429978c900843af84c /tests/bugs152
parentbe2aca6940a820f96cfc4a6deeb7d4be5bba767d (diff)
downloadaspectj-c8e1c4e4ef296b9108af8036f30baad4443b5afe.tar.gz
aspectj-c8e1c4e4ef296b9108af8036f30baad4443b5afe.zip
another scenario for 148545 - generic return type too.
Diffstat (limited to 'tests/bugs152')
-rw-r--r--tests/bugs152/pr148545/MyAspect2.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/bugs152/pr148545/MyAspect2.java b/tests/bugs152/pr148545/MyAspect2.java
new file mode 100644
index 000000000..8d4a76966
--- /dev/null
+++ b/tests/bugs152/pr148545/MyAspect2.java
@@ -0,0 +1,21 @@
+import java.util.Arrays;
+
+privileged public aspect MyAspect2 {
+
+ Object around(MyClass o, MyAnnotation a) :
+ execution(@MyAnnotation * *(..)) &&
+ target(o) &&
+ @annotation(a) {
+ if (isOneOf(o.getValue(), a.value())==null)
+ throw new IllegalStateException(
+ o.getValue() +
+ " is not one of " +
+ Arrays.toString(a.value()));
+ return proceed(o, a);
+ }
+
+ private static final <T> T isOneOf(T obj, T[] arr) {
+ for (T el : arr) if (obj == el) return obj;
+ return null;
+ }
+} \ No newline at end of file