diff options
author | acolyer <acolyer> | 2005-09-02 17:12:43 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-02 17:12:43 +0000 |
commit | df46c6f728502a74b2d042a0a955eab1326ba76a (patch) | |
tree | 5d0e149d509e85b685f532aee75c984afd2e09f1 /tests | |
parent | 2c88c598b950136bf54376eecbf58f14a19666c4 (diff) | |
download | aspectj-df46c6f728502a74b2d042a0a955eab1326ba76a.tar.gz aspectj-df46c6f728502a74b2d042a0a955eab1326ba76a.zip |
tests and fix for pr99125 - duplicate members in interfaces after binary weaving
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs150/pr99125/Aspects.aj | 19 | ||||
-rw-r--r-- | tests/bugs150/pr99125/p/I.java | 6 | ||||
-rw-r--r-- | tests/bugs150/pr99125/p/J.java | 4 | ||||
-rw-r--r-- | tests/bugs150/pr99125/p/pr99125.aj | 10 | ||||
-rw-r--r-- | tests/bugs150/pr99125/p2/pr99125.aj | 11 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 12 |
7 files changed, 66 insertions, 0 deletions
diff --git a/tests/bugs150/pr99125/Aspects.aj b/tests/bugs150/pr99125/Aspects.aj new file mode 100644 index 000000000..96fa6b4b6 --- /dev/null +++ b/tests/bugs150/pr99125/Aspects.aj @@ -0,0 +1,19 @@ +import p.*; + +abstract aspect X { + + public void I.bar() {} + + public void pr99125.aMethod() {} + +} + +aspect Y extends X { + + public void I.goo() {}; + + public void I.foo() { System.out.println("you got me"); } + +} + +aspect Z extends X {}
\ No newline at end of file diff --git a/tests/bugs150/pr99125/p/I.java b/tests/bugs150/pr99125/p/I.java new file mode 100644 index 000000000..fbbd7ace4 --- /dev/null +++ b/tests/bugs150/pr99125/p/I.java @@ -0,0 +1,6 @@ +package p; +public interface I { + + void foo(); + +}
\ No newline at end of file diff --git a/tests/bugs150/pr99125/p/J.java b/tests/bugs150/pr99125/p/J.java new file mode 100644 index 000000000..fc1331005 --- /dev/null +++ b/tests/bugs150/pr99125/p/J.java @@ -0,0 +1,4 @@ +package p; + +public +interface J extends I {}
\ No newline at end of file diff --git a/tests/bugs150/pr99125/p/pr99125.aj b/tests/bugs150/pr99125/p/pr99125.aj new file mode 100644 index 000000000..b4969d059 --- /dev/null +++ b/tests/bugs150/pr99125/p/pr99125.aj @@ -0,0 +1,10 @@ +package p; +public class pr99125 implements J { + + public static void main(String[] args) { + new pr99125().foo(); + } + + public void foo() {} + +} diff --git a/tests/bugs150/pr99125/p2/pr99125.aj b/tests/bugs150/pr99125/p2/pr99125.aj new file mode 100644 index 000000000..4f860c301 --- /dev/null +++ b/tests/bugs150/pr99125/p2/pr99125.aj @@ -0,0 +1,11 @@ +package p; +public class pr99125 implements J { + + public static void main(String[] args) { + new pr99125().foo(); + } + + public void foo() {} + + public void aMethod() {} +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 5db8119d1..57642f9bd 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -382,6 +382,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("unused private pointcuts"); } + public void testITDOnInterfaceWithExistingMember() { + runTest("itd interface method already existing on interface"); + } + // 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 aba23f729..e805601bf 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -473,6 +473,18 @@ <compile files="pr101606.aj" options="-warn:unusedPrivate"> </compile> </ajc-test> + + <ajc-test dir="bugs150/pr99125" pr="99125" title="itd interface method already existing on interface"> + <compile files="p/pr99125.aj,p/I.java,p/J.java" options="-1.5"> + </compile> + <compile files="Aspects.aj" options="-inpath p"/> + <run class="p.pr99125"/> + <compile files="p2/pr99125.aj,p/I.java,p/J.java"/> <!-- actually in package p, introduces incompatible change --> + <compile files="Aspects.aj" options="-inpath p"> + <message kind="error" line="7" text="inter-type declaration from X conflicts with existing member"/> + </compile> + </ajc-test> + <!-- ============================================================================ --> <!-- ============================================================================ --> |