From ec91e93ac09fa9a347a8e8d0f99db3585dd93060 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Mon, 17 Nov 2014 18:32:25 -0800 Subject: Further 451966: privileged aspect and ITDs --- tests/bugs185/451966/Code2.java | 31 ++++++++++++++++++++++ .../org/aspectj/systemtest/ajc185/Ajc185Tests.java | 7 ++++- tests/src/org/aspectj/systemtest/ajc185/ajc185.xml | 7 ++++- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 tests/bugs185/451966/Code2.java (limited to 'tests') diff --git a/tests/bugs185/451966/Code2.java b/tests/bugs185/451966/Code2.java new file mode 100644 index 000000000..d40211725 --- /dev/null +++ b/tests/bugs185/451966/Code2.java @@ -0,0 +1,31 @@ + +public class Code2 { + public static void main(String []argv) { + new Bar().foo(); + } +} +interface Common { } + +interface Allergies extends Common { + default public void foo() { + } +} + +class Bar implements Allergies { } + +aspect Y { + private boolean Common.instancesInvariant() { + return false; + } +} + +privileged aspect AspectJMLRac_allergies_Allergies { + before(final Allergies object$rac): execution(* Allergies+.*(..)) && this(object$rac) { + Runnable r = new Runnable() { + public void run() { + boolean b = object$rac.instancesInvariant(); + } + }; + boolean b = object$rac.instancesInvariant(); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc185/Ajc185Tests.java b/tests/src/org/aspectj/systemtest/ajc185/Ajc185Tests.java index 9fefaa5eb..135eb8464 100644 --- a/tests/src/org/aspectj/systemtest/ajc185/Ajc185Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc185/Ajc185Tests.java @@ -24,7 +24,12 @@ public class Ajc185Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testITDInterface_451966() throws Exception { runTest("itd interface"); } - + + public void testITDInterface_451966_2() throws Exception { + // call made from inner type + runTest("itd interface - 2"); + } + // --- public static Test suite() { diff --git a/tests/src/org/aspectj/systemtest/ajc185/ajc185.xml b/tests/src/org/aspectj/systemtest/ajc185/ajc185.xml index 5e8f8dc8a..7c30d7bf4 100644 --- a/tests/src/org/aspectj/systemtest/ajc185/ajc185.xml +++ b/tests/src/org/aspectj/systemtest/ajc185/ajc185.xml @@ -2,11 +2,16 @@ - + + + + + + -- cgit v1.2.3