From d6d80e8f072e199a70283bee27f7d3ffb3a8a3a6 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 24 Nov 2010 22:45:54 +0000 Subject: [PATCH] intertype inner types --- .../itdInnerTypes/separate/Basic.java | 11 ++++++++ .../itdInnerTypes/separate/Basic2.java | 6 +++++ .../systemtest/ajc169/AllTestsAspectJ169.java | 2 +- .../systemtest/ajc169/IntertypeTests.java | 17 ++++++++++++ .../aspectj/systemtest/ajc169/intertype.xml | 27 +++++++++++++------ 5 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 tests/features169/itdInnerTypes/separate/Basic.java create mode 100644 tests/features169/itdInnerTypes/separate/Basic2.java diff --git a/tests/features169/itdInnerTypes/separate/Basic.java b/tests/features169/itdInnerTypes/separate/Basic.java new file mode 100644 index 000000000..b76e6a43f --- /dev/null +++ b/tests/features169/itdInnerTypes/separate/Basic.java @@ -0,0 +1,11 @@ +public class Basic { + public static void main(String []argv) { + new _(); + System.out.println("done"); + } +} + +aspect XX { + public static class Basic._ { + } +} diff --git a/tests/features169/itdInnerTypes/separate/Basic2.java b/tests/features169/itdInnerTypes/separate/Basic2.java new file mode 100644 index 000000000..f44b45b3d --- /dev/null +++ b/tests/features169/itdInnerTypes/separate/Basic2.java @@ -0,0 +1,6 @@ +public class Basic2 { + public static void main(String []argv) { + new Basic._(); + System.out.println("done"); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc169/AllTestsAspectJ169.java b/tests/src/org/aspectj/systemtest/ajc169/AllTestsAspectJ169.java index 485a71a69..f143fca99 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/AllTestsAspectJ169.java +++ b/tests/src/org/aspectj/systemtest/ajc169/AllTestsAspectJ169.java @@ -20,7 +20,7 @@ public class AllTestsAspectJ169 { // $JUnit-BEGIN$ suite.addTest(Ajc169Tests.suite()); suite.addTest(TransparentWeavingTests.suite()); - // suite.addTest(IntertypeTests.suite()); + suite.addTest(IntertypeTests.suite()); // $JUnit-END$ return suite; } diff --git a/tests/src/org/aspectj/systemtest/ajc169/IntertypeTests.java b/tests/src/org/aspectj/systemtest/ajc169/IntertypeTests.java index de419eab7..6719b16ba 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/IntertypeTests.java +++ b/tests/src/org/aspectj/systemtest/ajc169/IntertypeTests.java @@ -43,6 +43,23 @@ import org.aspectj.testing.XMLBasedAjcTestCase; */ public class IntertypeTests extends org.aspectj.testing.XMLBasedAjcTestCase { + /** + * This is testing that on a secondary compile we can work out what happened in the first compile (where an inner type was + * intertyped onto another type). I think we need two conditions to be true for this to pass:
+ * 1) we need an innerclass attribute on the target type
+ * 2) we need the name of the innerclass to match its target rather than the declaring aspect
+ * Line 277 in ClassScope:
+ * + * memberTypeBindings[count++] = memberScope.buildType(sourceType, sourceType.fPackage, accessRestriction);
+ * which then: builds the name based on the containing aspect. + * + * TypeDeclaration.generateCode() + * + */ + public void testSeparateCompilation() throws Exception { + runTest("separate compilation"); + } + public void testErrorTargettingTypeThatAlreadyHasIt() { runTest("already has it"); } diff --git a/tests/src/org/aspectj/systemtest/ajc169/intertype.xml b/tests/src/org/aspectj/systemtest/ajc169/intertype.xml index b7d63078f..de6854faf 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/intertype.xml +++ b/tests/src/org/aspectj/systemtest/ajc169/intertype.xml @@ -2,9 +2,20 @@ + + + + + + + + + + - + + @@ -49,7 +60,7 @@ - + @@ -59,7 +70,7 @@ - + @@ -69,7 +80,7 @@ - + @@ -79,7 +90,7 @@ - + @@ -89,7 +100,7 @@ - + @@ -99,7 +110,7 @@ - + @@ -109,7 +120,7 @@ - + -- 2.39.5