scala-java8-compat
scala-java8-compat copied to clipboard
Documentation for Future.toJava is stricter than implemented functionality
It says here that the CompletionStage returned by FutureConverters doesn't support the toCompletableFuture() interface at all. However, it can be used fine to retrieve the value of a completed future, and/or wait for it. That functionality is currently used by e.g. akka.
The documentation could probably be extended to reflect that waiting / getting is fine, but completing is not.
Actually, if the behaviour is indeed correct, it might even make sense to upgrade the return type to either CompletableFuture , or to a sub-interface of CompletionStage that happens to have the CompletableFuture methods that are supported.