There is a ClassType.concreteMethodByName() method, but no InterfaceType.concreteMethodByName(). I suspect this is because JDI was designed before JDK 8, which is when support for interfaces having static (and default) methods was added. It would be convenient for developers if this method was added to InterfaceType. Note no JDWP changes are needed for this. It's all implemented within the JDI implementation. I think the ClassType version will work as-is for InterfaceType:
public Method concreteMethodByName(String name, String signature) {
Method method = null;
for (Method candidate : visibleMethods()) {
if (candidate.name().equals(name) &&
candidate.signature().equals(signature) &&
!candidate.isAbstract()) {
method = candidate;
break;
}
}
return method;
}
public Method concreteMethodByName(String name, String signature) {
Method method = null;
for (Method candidate : visibleMethods()) {
if (candidate.name().equals(name) &&
candidate.signature().equals(signature) &&
!candidate.isAbstract()) {
method = candidate;
break;
}
}
return method;
}