@@ -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; | |||
} |
@@ -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; | |||
} |
@@ -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) { |
@@ -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> | |||
<!-- ============================================================================ --> | |||
<!-- ============================================================================ --> | |||