diff options
-rw-r--r-- | tests/bugs150/pr120521/PerTargetSubaspectError.java | 18 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 1 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 4 |
3 files changed, 23 insertions, 0 deletions
diff --git a/tests/bugs150/pr120521/PerTargetSubaspectError.java b/tests/bugs150/pr120521/PerTargetSubaspectError.java new file mode 100644 index 000000000..0f2443dad --- /dev/null +++ b/tests/bugs150/pr120521/PerTargetSubaspectError.java @@ -0,0 +1,18 @@ +package bugs; + +public class PerTargetSubaspectError { + public static void main(String[] args) { + C.run(); + } + static class C { + static void run() {} + } + pointcut doit() : execution(void C.run()); + + // no error if not pertarget + static aspect CPT pertarget(pc()){ + // no error if doit() defined in CPT + protected pointcut pc() : doit(); // unexpected CE + before() : doit() {} // no CE + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index f00f601a9..dfc65f860 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -41,6 +41,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { protected File getSpecFile() { return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml"); } + //public void testNamedPointcutPertarget_pr120521() { runTest("named pointcut not resolved in pertarget pointcut");} public void testDollarClasses_pr120474() { runTest("Dollar classes");} public void testGenericPTW_pr119539_1() { runTest("generic pertypewithin aspect - 1");} public void testGenericPTW_pr119539_2() { runTest("generic pertypewithin aspect - 2");} diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index ed4d8c155..790dca6f9 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -78,6 +78,10 @@ <compile files="ParameterizedDP.java,NodeImpl.java,INode.java" options="-1.5"/> <run class="bugs.ParameterizedDP"/> </ajc-test> + + <ajc-test dir="bugs150/pr120521" pr="120521" title="named pointcut not resolved in pertarget pointcut"> + <compile files="PerTargetSubaspectError.java"/> + </ajc-test> <ajc-test dir="bugs150/pr119210" pr="119210" title="autoboxing around advice - 1"> <compile files="TestLib.java,ThreadAspectLib.java" options="-1.5"/> |