diff options
author | acolyer <acolyer> | 2005-09-02 13:45:25 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-02 13:45:25 +0000 |
commit | e29ca524955b2112bbf63e740ca71516c13fbb4c (patch) | |
tree | c6be1b77f9071cb24cdba1e2cf91f325c90ce9e1 /tests | |
parent | 047173e8683e4ab9004ae2151a8abad886d1b84b (diff) | |
download | aspectj-e29ca524955b2112bbf63e740ca71516c13fbb4c.tar.gz aspectj-e29ca524955b2112bbf63e740ca71516c13fbb4c.zip |
tests and fix for pr1202212 - poor job of testing modifiers on ITD methods
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs150/pr102212.aj | 22 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 5 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 6 |
3 files changed, 33 insertions, 0 deletions
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 @@ </stdout> </run> </ajc-test> + + <ajc-test dir="bugs150" pr="102212" title="abstract synchronized itdms not detected"> + <compile files="pr102212.aj"> + <message line="7" kind="error" text="The abstract method _abstract in type Parent can only set a visibility modifier, one of public or protected"/> + </compile> + </ajc-test> <!-- ============================================================================ --> <!-- ============================================================================ --> |