I can't figure out how to extend ThreadPoolExecutor.
It says I have to re-implement some of the methods (I assume it’s because of the @NotNull annotations)
I figured out the syntax to forward some of the them to the super class:
public override fun awaitTermination(timeout: Long, unit: TimeUnit): Boolean {
return super<ThreadPoolExecutor>.awaitTermination(timeout, unit: TimeUnit?)
}
I am running into troubles when generics are involved though. This doesn’t work:
public override fun <T> invokeAny(tasks: Collection<out Callable<T>>): T? {
super<ThreadPoolExecutor>.invokeAny(tasks: Collection<out Callable<T>?>?)
}
Is there a way to write it correctly or is it simply a bug?