diff options
author | acolyer <acolyer> | 2005-09-05 14:07:39 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-05 14:07:39 +0000 |
commit | a905c8e46f43684ef19adc4817374b82f2b0993d (patch) | |
tree | 63f6ef8a407ca6cae02d6e3a90a7b550ec8b9f7a /tests | |
parent | df46c6f728502a74b2d042a0a955eab1326ba76a (diff) | |
download | aspectj-a905c8e46f43684ef19adc4817374b82f2b0993d.tar.gz aspectj-a905c8e46f43684ef19adc4817374b82f2b0993d.zip |
tests for pr87530, final modifier on interface itdm
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs150/pr87530/FinalITDMOnInterface.aj | 28 | ||||
-rw-r--r-- | tests/bugs150/pr87530/FinalITDMOnInterface2.aj | 24 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 10 |
4 files changed, 65 insertions, 1 deletions
diff --git a/tests/bugs150/pr87530/FinalITDMOnInterface.aj b/tests/bugs150/pr87530/FinalITDMOnInterface.aj new file mode 100644 index 000000000..b03bdef53 --- /dev/null +++ b/tests/bugs150/pr87530/FinalITDMOnInterface.aj @@ -0,0 +1,28 @@ +public class FinalITDMOnInterface { + + public static void main(String[] args) { + FinalITDMOnInterface f = new Sub(); + f.m(); + } + +} + +class Sub extends FinalITDMOnInterface { + + public void m() { + System.out.println("in class method"); + } + +} + +aspect A { + + interface TestInterface {} + + public final void TestInterface.m() { + System.out.println("in aspect declared method"); + } + + declare parents : FinalITDMOnInterface implements TestInterface; + +}
\ No newline at end of file diff --git a/tests/bugs150/pr87530/FinalITDMOnInterface2.aj b/tests/bugs150/pr87530/FinalITDMOnInterface2.aj new file mode 100644 index 000000000..5b08e6e6d --- /dev/null +++ b/tests/bugs150/pr87530/FinalITDMOnInterface2.aj @@ -0,0 +1,24 @@ +public class FinalITDMOnInterface2 { + + public static void main(String[] args) { + FinalITDMOnInterface2 f = new FinalITDMOnInterface2(); + f.m(); + } + + public void m() { + System.out.println("in class method"); + } + +} + +aspect A { + + interface TestInterface {} + + public final void TestInterface.m() { + System.out.println("in aspect declared method"); + } + + declare parents : FinalITDMOnInterface2 implements TestInterface; + +}
\ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 57642f9bd..d2ca4d9cf 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -386,6 +386,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("itd interface method already existing on interface"); } + public void testFinalITDMOnInterface() { + runTest("final itd methods on interfaces"); + } + // 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 e805601bf..27df1824a 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -485,7 +485,15 @@ </compile> </ajc-test> - + <ajc-test dir="bugs150/pr87530" pr="87530" title="final itd methods on interfaces"> + <compile files="FinalITDMOnInterface.aj"> + <message kind="error" line="12" text="Cannot override the final method from A.TestInterface"></message> + </compile> + <compile files="FinalITDMOnInterface2.aj"> + <message kind="error" line="8" text="Cannot override the final method from A.TestInterface"></message> + </compile> + </ajc-test> + <!-- ============================================================================ --> <!-- ============================================================================ --> |