mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test++, compilation fixed again
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
+7
@@ -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();
|
||||
}
|
||||
+23
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user