diff options
author | Andy Clement <aclement@gopivotal.com> | 2014-04-15 16:51:02 -0700 |
---|---|---|
committer | Andy Clement <aclement@gopivotal.com> | 2014-04-15 16:51:02 -0700 |
commit | c641ffdbb6c04956a7b1a6d6c89c9c6c67be0761 (patch) | |
tree | 3391f978edd551335757a67d6c03c5890c3312c5 | |
parent | 5aaca752afa424015f81379dcd0a69e737340e56 (diff) | |
download | aspectj-c641ffdbb6c04956a7b1a6d6c89c9c6c67be0761.tar.gz aspectj-c641ffdbb6c04956a7b1a6d6c89c9c6c67be0761.zip |
Fix 432178: percflow concreteaspectcodegen problem
-rw-r--r-- | loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java | 6 | ||||
-rw-r--r-- | tests/bugs180/432178/A.java | 9 | ||||
-rw-r--r-- | tests/bugs180/432178/B.java | 7 | ||||
-rw-r--r-- | tests/bugs180/432178/PerCFlowBug.java | 11 | ||||
-rw-r--r-- | tests/bugs180/432178/aop.xml | 9 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc180/Ajc180Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc180/ajc180.xml | 11 |
7 files changed, 54 insertions, 3 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java b/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java index 620b84874..c0fd9d342 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java @@ -366,11 +366,11 @@ public class ConcreteAspectCodeGen { if (bytes != null) { return bytes; } + PerClause.Kind perclauseKind = PerClause.SINGLETON; PerClause parentPerClause = (parent != null ? parent.getPerClause() : null); - if (parentPerClause == null) { - parentPerClause = new PerSingleton(); + if (parentPerClause != null) { + perclauseKind = parentPerClause.getKind(); } - PerClause.Kind perclauseKind = PerClause.SINGLETON; String perclauseString = null; if (concreteAspect.perclause != null) { diff --git a/tests/bugs180/432178/A.java b/tests/bugs180/432178/A.java new file mode 100644 index 000000000..1ed166fa6 --- /dev/null +++ b/tests/bugs180/432178/A.java @@ -0,0 +1,9 @@ +public class A +{ + public static void main(String [] args) + { + B test = new B(); + test.met(); + } +} + diff --git a/tests/bugs180/432178/B.java b/tests/bugs180/432178/B.java new file mode 100644 index 000000000..624865cc9 --- /dev/null +++ b/tests/bugs180/432178/B.java @@ -0,0 +1,7 @@ +public class B +{ + public void met() + { + System.out.println("foo"); + } +} diff --git a/tests/bugs180/432178/PerCFlowBug.java b/tests/bugs180/432178/PerCFlowBug.java new file mode 100644 index 000000000..e81bd65c4 --- /dev/null +++ b/tests/bugs180/432178/PerCFlowBug.java @@ -0,0 +1,11 @@ +public abstract aspect PerCFlowBug percflow(pointexp()) +{ + String name = "bar"; + + abstract pointcut pointexp(); + + after() : pointexp() + { + System.out.println(name); + } +} diff --git a/tests/bugs180/432178/aop.xml b/tests/bugs180/432178/aop.xml new file mode 100644 index 000000000..dc317213e --- /dev/null +++ b/tests/bugs180/432178/aop.xml @@ -0,0 +1,9 @@ +<aspectj> + <aspects> + <concrete-aspect name="PerCFlowBugImpl" extends="PerCFlowBug"> + <pointcut name="pointexp" expression="(call (void *.met(..)))"/> + </concrete-aspect> + </aspects> + <weaver options="-verbose -debug -showWeaveInfo" > + </weaver> +</aspectj> diff --git a/tests/src/org/aspectj/systemtest/ajc180/Ajc180Tests.java b/tests/src/org/aspectj/systemtest/ajc180/Ajc180Tests.java index 9a200fa9a..d4231d369 100644 --- a/tests/src/org/aspectj/systemtest/ajc180/Ajc180Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc180/Ajc180Tests.java @@ -21,6 +21,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase; */ public class Ajc180Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testPercflowLtw_432178() { + runTest("percflow ltw"); + } + public void testStackmapframe_431976() { runTest("stackmapframe"); } diff --git a/tests/src/org/aspectj/systemtest/ajc180/ajc180.xml b/tests/src/org/aspectj/systemtest/ajc180/ajc180.xml index 924ec89e5..5b7ba57a7 100644 --- a/tests/src/org/aspectj/systemtest/ajc180/ajc180.xml +++ b/tests/src/org/aspectj/systemtest/ajc180/ajc180.xml @@ -2,6 +2,17 @@ <suite> + <ajc-test dir="bugs180/432178" title="percflow ltw"> + <compile options="-1.8" files="A.java B.java"/> + <compile options="-1.8" files="PerCFlowBug.java"/> + <run class="A" ltw="aop.xml"> + <stdout> + <line text="foo"/> + <line text="bar"/> + </stdout> + </run> + </ajc-test> + <ajc-test dir="bugs180/pr432714" title="stackmapframe"> <compile options="-1.8" files="Code.java"/> <run class="Code"/> |