Browse Source

tests for pr87530, final modifier on interface itdm

tags/preDefaultReweavable
acolyer 18 years ago
parent
commit
a905c8e46f

+ 28
- 0
tests/bugs150/pr87530/FinalITDMOnInterface.aj View File

@@ -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;
}

+ 24
- 0
tests/bugs150/pr87530/FinalITDMOnInterface2.aj View File

@@ -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;
}

+ 4
- 0
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java View File

@@ -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) {

+ 9
- 1
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml View File

@@ -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>

<!-- ============================================================================ -->
<!-- ============================================================================ -->

Loading…
Cancel
Save