test++, compilation fixed again

This commit is contained in:
Dmitry Jemerov
2009-09-10 20:48:45 +04:00
parent f9dbab8f6d
commit 58fee2c041
114 changed files with 17 additions and 12 deletions
@@ -0,0 +1,11 @@
public class A implements I {
private final Base myDelegate = new Base();
public Base getMyDelegate() {
return myDelegate;
}
public void methodFromI() {
myDelegate.methodFromI();
}
}
@@ -0,0 +1,7 @@
public class Base implements I, J {
public void methodFromI() {
}
public void methodFromJ() {
}
}
@@ -0,0 +1,3 @@
public interface I {
void methodFromI();
}
@@ -0,0 +1,3 @@
public interface J {
void methodFromJ();
}
@@ -0,0 +1,23 @@
class Usage {
private A myA = new A();
public void methodExpectingI(I i) {
i.methodFromI();
}
public J methodReturningJ() {
return myA.getMyDelegate();
}
public void methodExpectingJ(J j) {
j.methodFromJ();
}
public void main() {
A a = new A();
a.methodFromI();
a.getMyDelegate().methodFromJ();
methodExpectingI(a);
methodExpectingJ(a.getMyDelegate());
methodExpectingJ(myA.getMyDelegate());
}
}