From 5c5803307fcc99fa0f830b55000adadef3d857c9 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 11 Jul 2006 07:56:23 +0000 Subject: [PATCH] test for 121805. commented out test for 145442 (not recreated yet) --- tests/bugs153/pr121805/Complex.java | 41 +++++++++++++++++++ .../bugs153/pr145442/MissingLineNumbers.java | 18 ++++++++ .../systemtest/ajc153/Ajc153Tests.java | 2 + .../org/aspectj/systemtest/ajc153/ajc153.xml | 11 ++++- 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 tests/bugs153/pr121805/Complex.java create mode 100644 tests/bugs153/pr145442/MissingLineNumbers.java diff --git a/tests/bugs153/pr121805/Complex.java b/tests/bugs153/pr121805/Complex.java new file mode 100644 index 000000000..aa6d025c1 --- /dev/null +++ b/tests/bugs153/pr121805/Complex.java @@ -0,0 +1,41 @@ +class CommonEntity { + + public void add(CommonEntity ce) {} + public void remove(CommonEntity ce) {} + +} + +class ManageEntity { + + ManageEntity(CommonEntity ce) { + } +} + + +abstract aspect Y { + abstract pointcut entityAccessor(CommonEntity entity); + before(CommonEntity entity): entityAccessor(entity) {} +} + + +aspect X extends Y { + + public pointcut entityAccessor1(CommonEntity entity) + : (execution(* CommonEntity+.add*(CommonEntity+)) + || (execution(* CommonEntity+.remove*(CommonEntity+)))) + && within(CommonEntity+) + && args(entity) && if(entity != null); + + public pointcut entityAccessor2(CommonEntity entity) + : execution(ManageEntity.new(CommonEntity+, ..)) + && within(ManageEntity) + && args(entity, ..) + && if(entity != null); + + public pointcut entityAccessor(CommonEntity entity) + : entityAccessor1(entity) || entityAccessor2(entity); + + +} + + diff --git a/tests/bugs153/pr145442/MissingLineNumbers.java b/tests/bugs153/pr145442/MissingLineNumbers.java new file mode 100644 index 000000000..08cca8fa1 --- /dev/null +++ b/tests/bugs153/pr145442/MissingLineNumbers.java @@ -0,0 +1,18 @@ +public class MissingLineNumbers { + public static void main(String []argv) { + new MissingLineNumbers().foo(); + } + + public void foo() { + System.err.println("hello"); + System.err.println("world"); + } +} + +aspect X { + void around(): call(* foo(..)) { + new RuntimeException().printStackTrace(); + } +} + + diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java index 1fced4c80..6bb35d241 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java @@ -19,8 +19,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + // public void testMissingLineNumbersInStacktrace_pr145442() { runTest("missing line numbers in stacktrace");} // public void testArgnamesAndJavac_pr148381() { runTest("argNames and javac");} // public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); } + public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");} public void testGenericInheritanceDecp_pr150095() { runTest("generics, inheritance and decp");} public void testIllegalStateException_pr148737() { runTest("illegalstateexception for non generic type");} public void testAtajInheritance_pr149305_1() { runTest("ataj inheritance - 1");} diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml index 0181bd597..cead63fd8 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml @@ -111,7 +111,16 @@ - + + + + + + + + + +