From e29ca524955b2112bbf63e740ca71516c13fbb4c Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 2 Sep 2005 13:45:25 +0000 Subject: tests and fix for pr1202212 - poor job of testing modifiers on ITD methods --- tests/bugs150/pr102212.aj | 22 ++++++++++++++++++++++ .../org/aspectj/systemtest/ajc150/Ajc150Tests.java | 5 +++++ tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 tests/bugs150/pr102212.aj (limited to 'tests') diff --git a/tests/bugs150/pr102212.aj b/tests/bugs150/pr102212.aj new file mode 100644 index 000000000..04c754d6c --- /dev/null +++ b/tests/bugs150/pr102212.aj @@ -0,0 +1,22 @@ +interface Interface {} +abstract class Parent {} +class Child extends Parent implements Interface {} + +public aspect pr102212 { + // illegal modifier combination not caught by ajc + public abstract synchronized void Parent._abstract(); + + public synchronized void Child._abstract() {} + + + // the following is legal - it's a default implementation.... + public /* implicit abstract */ synchronized void Interface._interface() {} + + + // use Child to make java complain: "illegal modifiers: 0x421" + // (this corresponds to "public abstract synchronized") + public static void main(String[] args) { + new Child(); + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 4f6d82ac4..d9baeec72 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -369,6 +369,11 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testOverrideAndCovarianceWithDecPRuntimeMultiFiles() { runTest("override and covariance with decp - runtime separate files"); } + + public void testAbstractSynchronizedITDMethods() { + runTest("abstract synchronized itdms not detected"); + } + // helper methods..... public SyntheticRepository createRepos(File cpentry) { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index f36716f53..fc7622c38 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -456,6 +456,12 @@ + + + + + + -- cgit v1.2.3