guava
guava copied to clipboard
Remove @Beta from Futures.transform, catching, and *Async variants
These methods are very heavily used internally. They're probably less so externally, but that may change as AndroidX exposes ListenableFuture in more APIs. Plus, Dagger Producers uses these methods.
Blockers:
- likely change to make
catchingnot catch theCancellationExceptionfrom cancellation (internal bug 27587642) - possible changes to interruption behavior (https://github.com/google/guava/issues/1989)
We could even try to change the parameter type to the JDK Function someday (using a trick to temporarily maintain binary compatibility), but I'm not sure we'd do it.
https://github.com/google/guava/issues/3620 mentions the possibility of changing the return type of these methods (and others). But we could still do that after removing @Beta as long as we don't "just change" it: We'd have to inject bridge methods with the old signatures, as we already do for some other cases of signature changes.
Anyway, my thinking lately has been that the possible interruption change doesn't necessarily block this, either, but that the possible CancellationException change for catching probably does.
I'm not entirely sure why I feel that way: Both are changes to behavior but not to mention signatures, and both are likely to have negative results for a very small percentage of callers. Maybe it's the fact that the CancellationException behavior is actually documented?
I'm going to avoid making a snap judgment after not having thought about this in a long time. But maybe I can talk myself into this. Worst case, there are a number of other methods in Futures that we probably can easily remove @Beta from.
This is now fixed.