Interface default method not exist when extended by another interface
Vancior opened this issue · comments
Suppose we have class C -|> interface IB -|> interface IA
, while IA
has a default method foo
which is not overwriten by any of its children, then invocation on c.foo()
would fail with Method foo([]) does not exist
.
interface IA {
default String foo() {
return "foo " + bar();
}
String bar();
}
interface IB extends IA {}
public static class C implements IB {
public String bar() {
return "C#bar()";
}
}
Interesting. Does this work in the regular reflection but not work in Py4J?
Interesting. Does this work in the regular reflection but not work in Py4J?
C.class.getMethod("foo").invoke(new C())
works.
I guess it's here that super classes of interfaces are not scanned.
py4j/py4j-java/src/main/java/py4j/reflection/ReflectionEngine.java
Lines 350 to 352 in b4514ec