in Java 8, the param mayInterruptIfRunning
of method CompletableFuture#cancel(mayInterruptIfRunning)
not take effect, which I think violate contract defined in java.util.concurrent.Future
.
It will cause problem when migrate code from Future
to CompletableFuture
without noticing this contract change.
Also it seems violate Liskov substitution principle.
related article: https://www.nurkiewicz.com/2015/03/completablefuture-cant-be-interrupted.html