From b3a2c080204f65a6dc653926c230f74723925a30 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 21 Jul 2010 21:28:52 +0000 Subject: 278496: model deletion, allow for inner aspects --- .../PR278496_4/base/src/foo/MyClass.java | 20 +++++++++++ .../PR278496_4/base/src/foo/MyOtherClass.java | 17 ++++++++++ .../aspectj/systemtest/ajc169/IntertypeTests.java | 7 ++-- .../tools/IncrementalCompilationTests.java | 39 ++++++++++++++++++++-- 4 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 tests/multiIncremental/PR278496_4/base/src/foo/MyClass.java create mode 100644 tests/multiIncremental/PR278496_4/base/src/foo/MyOtherClass.java (limited to 'tests') diff --git a/tests/multiIncremental/PR278496_4/base/src/foo/MyClass.java b/tests/multiIncremental/PR278496_4/base/src/foo/MyClass.java new file mode 100644 index 000000000..829bff4a8 --- /dev/null +++ b/tests/multiIncremental/PR278496_4/base/src/foo/MyClass.java @@ -0,0 +1,20 @@ +package foo; + +/** + * @author Sian + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class MyClass { + + + public static void main(String[] args) { + + } + + public void method1() {} + + public void method2() {} +} + diff --git a/tests/multiIncremental/PR278496_4/base/src/foo/MyOtherClass.java b/tests/multiIncremental/PR278496_4/base/src/foo/MyOtherClass.java new file mode 100644 index 000000000..655faacd5 --- /dev/null +++ b/tests/multiIncremental/PR278496_4/base/src/foo/MyOtherClass.java @@ -0,0 +1,17 @@ +package foo; +public class MyOtherClass { + + public static class MyInnerClass { + + public static aspect MyInnerInnerAspect { + + before(): execution(* MyClass.method1()) { + System.out.println("Before method1.."); + } + + } + + } + +} + diff --git a/tests/src/org/aspectj/systemtest/ajc169/IntertypeTests.java b/tests/src/org/aspectj/systemtest/ajc169/IntertypeTests.java index 6090458ab..fd7f57dd0 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/IntertypeTests.java +++ b/tests/src/org/aspectj/systemtest/ajc169/IntertypeTests.java @@ -17,6 +17,7 @@ import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.apache.bcel.util.SyntheticRepository; import org.aspectj.asm.AsmManager; +import org.aspectj.asm.IRelationshipMap; import org.aspectj.testing.XMLBasedAjcTestCase; /** @@ -130,10 +131,12 @@ public class IntertypeTests extends org.aspectj.testing.XMLBasedAjcTestCase { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter pw = new PrintWriter(baos); AsmManager.dumptree(pw, AsmManager.lastActiveStructureModel.getHierarchy().getRoot(), 0); - pw.write(AsmManager.lastActiveStructureModel.getRelationshipMap().toString()); + IRelationshipMap irm = AsmManager.lastActiveStructureModel.getRelationshipMap(); + pw.write(irm.toString()); pw.flush(); String model = baos.toString(); - assertTrue(model.indexOf("<{Choice.java[Choice=[aspect declarations], <{Choice.java}X[Keys=[declared on]") != -1); + assertTrue(model.indexOf("<{Choice.java[Choice=[aspect declarations]") != -1); + assertTrue(model.indexOf("<{Choice.java}X[Keys=[declared on]") != -1); } public void testGenerics1() throws Exception { diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java index a762bab06..7d8cb973d 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/IncrementalCompilationTests.java @@ -210,7 +210,7 @@ public class IncrementalCompilationTests extends AbstractMultiProjectIncremental AspectJElementHierarchy model = (AspectJElementHierarchy) getModelFor(p).getHierarchy(); // Node for "Code.java" should not be there: - IProgramElement ipe = model.findElementForHandleOrCreate("=PR278496_1 [advice] 8 hid:=PR278496_4