diff options
author | aclement <aclement> | 2004-08-20 13:25:33 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-08-20 13:25:33 +0000 |
commit | bbc409e17b6781826e86c3548790668553a8636b (patch) | |
tree | d9c9371c1d7fc1f190e450f098381a4a912d2d4f /tests | |
parent | 06f6b999f67331be0ea6a0b55025195b3d252deb (diff) | |
download | aspectj-bbc409e17b6781826e86c3548790668553a8636b.tar.gz aspectj-bbc409e17b6781826e86c3548790668553a8636b.zip |
Fix for Bugzilla Bug 70794
The introduction on interface causes the interface implementation class error
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs/interfaceITDs/PackagePackage.java | 27 | ||||
-rw-r--r-- | tests/bugs/interfaceITDs/PackagePublic.java | 23 | ||||
-rw-r--r-- | tests/bugs/interfaceITDs/PublicPackage.java | 23 | ||||
-rw-r--r-- | tests/bugs/interfaceITDs/PublicPublic.java | 23 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java | 16 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml | 28 |
6 files changed, 139 insertions, 1 deletions
diff --git a/tests/bugs/interfaceITDs/PackagePackage.java b/tests/bugs/interfaceITDs/PackagePackage.java new file mode 100644 index 000000000..012f31d94 --- /dev/null +++ b/tests/bugs/interfaceITDs/PackagePackage.java @@ -0,0 +1,27 @@ +interface PackagePackage { + //empty interface +} + + +//aspectj introduce a method to this interface + privileged aspect aspectWorld { + abstract void PackagePackage.world(); +// void test.andy() { +// +// } + +} + +//class test implements hello interface, and +//method world + class test implements PackagePackage{ + + public void world() { + System.out.println("hello"); + } + + public static void main(String[] args) { + test t = new test(); + t.world(); + } +}
\ No newline at end of file diff --git a/tests/bugs/interfaceITDs/PackagePublic.java b/tests/bugs/interfaceITDs/PackagePublic.java new file mode 100644 index 000000000..55366a035 --- /dev/null +++ b/tests/bugs/interfaceITDs/PackagePublic.java @@ -0,0 +1,23 @@ +interface PackagePublic { + //empty interface +} + + +//aspectj introduce a method to this interface + privileged aspect aspectWorld { + public abstract void PackagePublic.world(); +} + +//class test implements hello interface, and +//method world + class test implements PackagePublic{ + + public void world() { + System.out.println("hello"); + } + + public static void main(String[] args) { + test t = new test(); + t.world(); + } +}
\ No newline at end of file diff --git a/tests/bugs/interfaceITDs/PublicPackage.java b/tests/bugs/interfaceITDs/PublicPackage.java new file mode 100644 index 000000000..ec79ad2c7 --- /dev/null +++ b/tests/bugs/interfaceITDs/PublicPackage.java @@ -0,0 +1,23 @@ +public interface PublicPackage { + //empty interface +} + + +//aspectj introduce a method to this interface +privileged aspect aspectWorld { + abstract void PublicPackage.world(); +} + +//class test implements hello interface, and +//method world + class test implements PublicPackage { + + public void world() { + System.out.println("hello"); + } + + public static void main(String[] args) { + test t = new test(); + t.world(); + } +}
\ No newline at end of file diff --git a/tests/bugs/interfaceITDs/PublicPublic.java b/tests/bugs/interfaceITDs/PublicPublic.java new file mode 100644 index 000000000..2ebad56fd --- /dev/null +++ b/tests/bugs/interfaceITDs/PublicPublic.java @@ -0,0 +1,23 @@ +public interface PublicPublic { + //empty interface +} + + +//aspectj introduce a method to this interface +privileged aspect aspectWorld { + public abstract void PublicPublic.world(); +} + +//class test implements hello interface, and +//method world + class test implements PublicPublic { + + public void world() { + System.out.println("hello"); + } + + public static void main(String[] args) { + test t = new test(); + t.world(); + } +}
\ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java index 93353cb8e..bd1bb32bc 100644 --- a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java @@ -248,5 +248,21 @@ public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("wrong line for method execution join point"); } + public void test046_interfaceITD_pr70794_1() { + runTest("The introduction on interface causes the interface implementation class error (1)"); + } + + public void test047_interfaceITD_pr70794_2() { + runTest("The introduction on interface causes the interface implementation class error (2)"); + } + + public void test048_interfaceITD_pr70794_3() { + runTest("The introduction on interface causes the interface implementation class error (3)"); + } + + public void test049_interfaceITD_pr70794_4() { + runTest("The introduction on interface causes the interface implementation class error (4)"); + } + } diff --git a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml index 9ec3782b4..98cb69fdd 100644 --- a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml @@ -377,4 +377,30 @@ <message kind="warning" line="39" text="static init"/> <message kind="warning" line="47" text="advice"/> </compile> - </ajc-test>
\ No newline at end of file + </ajc-test> + + <ajc-test dir="bugs/interfaceITDs" pr="70794" + title="The introduction on interface causes the interface implementation class error (1)"> + <compile files="PublicPublic.java"/> + </ajc-test> + + + <ajc-test dir="bugs/interfaceITDs" pr="70794" + title="The introduction on interface causes the interface implementation class error (2)"> + <compile files="PackagePublic.java"/> + </ajc-test> + + <ajc-test dir="bugs/interfaceITDs" pr="70794" + title="The introduction on interface causes the interface implementation class error (3)"> + <compile files="PackagePackage.java"> + <message kind="error" line="17" text="abstract intertype method declaration 'void PackagePackage.world()' on interface PackagePackage must be declared public (compiler limitation)"/> + </compile> + </ajc-test> + + <ajc-test dir="bugs/interfaceITDs" pr="70794" + title="The introduction on interface causes the interface implementation class error (4)"> + <compile files="PublicPackage.java"> + <message kind="error" line="13" text="abstract intertype method declaration 'void PublicPackage.world()' on interface PublicPackage must be declared public (compiler limitation)"/> + </compile> + </ajc-test> + |