mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-14 02:10:40 +02:00
34 lines
932 B
Java
34 lines
932 B
Java
import org.aspectj.testing.*;
|
|
|
|
|
|
/** @testcase PR#645 PUREJAVA Parent interface using public inner interface of child in same file */
|
|
interface Child extends Parent {
|
|
public interface Inner {
|
|
public String ok();
|
|
}
|
|
}
|
|
|
|
/** Parent must be in same file as child and be declared AFTER */
|
|
interface Parent {
|
|
public Child.Inner getChildInner();
|
|
}
|
|
|
|
public class ParentInterfaceUsingChildInnerInterface {
|
|
public static void main (String[] args) {
|
|
Example me = new Example();
|
|
String result = me.getChildInner().ok();
|
|
Tester.check(((result != null) && result.startsWith("ok")),
|
|
"expected ok... got " + result);
|
|
}
|
|
}
|
|
|
|
class Example implements Parent {
|
|
public Child.Inner getChildInner() {
|
|
return new Child.Inner() {
|
|
public String ok() {
|
|
return "ok: " + getClass().getName();
|
|
}
|
|
};
|
|
}
|
|
}
|