In the IWorkerHook there is a default method
default void start(Map<String, Object> topoConf, WorkerUserContext context) {
start(topoConf, context);
}
That ends up calling its self. I think the intention was to have it default to calling the deprecated method
default void start(Map<String, Object> topoConf, WorkerTopologyContext context) {
// NOOP
}
In order for that to work I beleive the first default method needs to be changed to:
default void start(Map<String, Object> topoConf, WorkerUserContext context) {
start(topoConf, (WorkerTopologyContext)context);
}
If you write a test for example like
@Test
void testWorkerHook(@Mock WorkerUserContext workerUContext) {
IWorkerHook wHook = new IWorkerHook() {
private static final long serialVersionUID = 3766266493839497755L;
@Override
public void shutdown() {}
};
wHook.start(Collections.emptyMap(), workerUContext);
}
It will result in a java.lang.StackOverflowError
In the IWorkerHook there is a default method
That ends up calling its self. I think the intention was to have it default to calling the deprecated method
In order for that to work I beleive the first default method needs to be changed to:
If you write a test for example like
It will result in a java.lang.StackOverflowError