From: aclement Date: Mon, 26 Jun 2006 07:31:36 +0000 (+0000) Subject: another scenario for 148545 - generic return type too. X-Git-Tag: V1_5_2rc1~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c8e1c4e4ef296b9108af8036f30baad4443b5afe;p=aspectj.git another scenario for 148545 - generic return type too. --- 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 isOneOf(T obj, T[] arr) { + for (T el : arr) if (obj == el) return obj; + return null; + } +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java index 8f5dbcd39..17996d89e 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java @@ -36,6 +36,7 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // public void testAdviceNotWovenAspectPath_pr147841() { runTest("advice not woven on aspectpath");} // public void testClassCastForInvalidAnnotationValue_pr148537() { runTest("classcast annotation value");} public void testPrivilegeGeneric_pr148545() { runTest("nosuchmethoderror for privileged aspect");} + public void testPrivilegeGeneric_pr148545_2() { runTest("nosuchmethoderror for privileged aspect - 2");} public void testUnknownAnnotationNPE() { runTest("NPE for unknown annotation");} public void testDuplicateBridgeMethods_pr147801_1() { runTest("duplicate bridge methods");} public void testPackageIgnoredForException_pr147701_1() { runTest("package for exception ignored");} diff --git a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml index 4c916532a..481e3243c 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml +++ b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml @@ -114,8 +114,15 @@ - - + + + + + + + + +