summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoracolyer <acolyer>2006-05-02 17:02:25 +0000
committeracolyer <acolyer>2006-05-02 17:02:25 +0000
commit18c308fb3c26227f7cae5ad728d3565079edd4b5 (patch)
tree9028307185ac9c8632cd402df99583b641fcab81 /tests
parentc5c18aaea1700d75e8f92a530133ae371924f33c (diff)
downloadaspectj-18c308fb3c26227f7cae5ad728d3565079edd4b5.tar.gz
aspectj-18c308fb3c26227f7cae5ad728d3565079edd4b5.zip
tests for pr139749 - calling super in @AspectJ advice body causes VerifyError
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs152/pr139749/AroundAdvicePassingPjpAsArgToSuper.java36
-rw-r--r--tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java3
-rw-r--r--tests/src/org/aspectj/systemtest/ajc152/ajc152.xml5
3 files changed, 43 insertions, 1 deletions
diff --git a/tests/bugs152/pr139749/AroundAdvicePassingPjpAsArgToSuper.java b/tests/bugs152/pr139749/AroundAdvicePassingPjpAsArgToSuper.java
new file mode 100644
index 000000000..0a0ada0a0
--- /dev/null
+++ b/tests/bugs152/pr139749/AroundAdvicePassingPjpAsArgToSuper.java
@@ -0,0 +1,36 @@
+
+package a.b.c;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+class ASuperClass {
+
+ protected void takesApjp(ProceedingJoinPoint pjp) {
+ System.out.println(pjp);
+ }
+
+}
+
+@Aspect
+public class AroundAdvicePassingPjpAsArgToSuper extends ASuperClass {
+
+ @Around("execution(* foo())")
+ public Object passesPjp(ProceedingJoinPoint pjp) throws Throwable {
+ takesApjp(pjp);
+ Object ret = pjp.proceed();
+ return ret;
+ }
+
+ public static void main(String[] args) {
+ new C().foo();
+ }
+}
+
+class C {
+
+ public Object foo() {
+ return new Object();
+ }
+} \ 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 a89421cda..4ae8e9d89 100644
--- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
@@ -38,7 +38,8 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testReferencePCutInDeclareWarning_pr138215() { runTest("Reference pointcut fails inside @DeclareWarning");}
// public void testReferencePCutInPerClause_pr138219() { runTest("Can't use a FQ Reference pointcut in any pointcut expression referenced by a per-clause");}
// public void testDoubleAnnotationMatching_pr138223() { runTest("Double at annotation matching (no binding)");}
-
+// public void testSuperCallsInAtAspectJAdvice_pr139749() { runTest("Super calls in @AspectJ advice");}
+
public void testNoClassCastExceptionWithPerThis_pr138286() { runTest("No ClassCastException with perThis");}
// this next one reported as a bug by Rob Harrop, but I can't reproduce the failure yet...
diff --git a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml
index b9ab6e947..600c318ae 100644
--- a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml
+++ b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml
@@ -192,4 +192,9 @@
</run>
</ajc-test>
+ <ajc-test dir="bugs152/pr139749" pr="139749" title="Super calls in @AspectJ advice">
+ <compile files="AroundAdvicePassingPjpAsArgToSuper.java" options="-1.5">
+ </compile>
+ <run class="a.b.c.AroundAdvicePassingPjpAsArgToSuper"/>
+ </ajc-test>
</suite> \ No newline at end of file