From c641ffdbb6c04956a7b1a6d6c89c9c6c67be0761 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Tue, 15 Apr 2014 16:51:02 -0700 Subject: [PATCH] Fix 432178: percflow concreteaspectcodegen problem --- .../weaver/loadtime/ConcreteAspectCodeGen.java | 6 +++--- tests/bugs180/432178/A.java | 9 +++++++++ tests/bugs180/432178/B.java | 7 +++++++ tests/bugs180/432178/PerCFlowBug.java | 11 +++++++++++ tests/bugs180/432178/aop.xml | 9 +++++++++ .../org/aspectj/systemtest/ajc180/Ajc180Tests.java | 4 ++++ tests/src/org/aspectj/systemtest/ajc180/ajc180.xml | 11 +++++++++++ 7 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 tests/bugs180/432178/A.java create mode 100644 tests/bugs180/432178/B.java create mode 100644 tests/bugs180/432178/PerCFlowBug.java create mode 100644 tests/bugs180/432178/aop.xml 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 @@ + + + + + + + + + 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 @@ + + + + + + + + + + + -- 2.39.5