Guava compatibility agent which allows a subset of common APIs removed in older versions of guava to continue working at runtime, when a newer version of guava is available on the classpath.
MoreExecutors.sameThreadExecutor()
: Delegates to the modernMoreExecutors.newDirectExecutorService()
Objects.firstNonNull(first, second)
: Delegates to the modernMoreObjects.firstNonNull(first, second)
Futures.transform(future, function)
-> Delegates to the modernFutures.transform(future, function, MoreExecutors.directExecutor())
Futures.transform(future, asyncFunction, exec)
-> Delegates to the modernFutures.transformAsync(future, asyncFunction, exec)
Futures.transform(future, asyncFunction)
-> Delegates to the modernFutures.transformAsync(future, asyncFunction, MoreExecutors.directExecutor())
Futures.addCallback(future, callback)
->Futures.addCallback(future, callback, MoreExecutors.directExecutor())
Futures.withFallback(future, fallback, executor)
->Futures.catchingAsync(future, Throwable.class, fallback, executor)
Futures.withFallback(future, fallback)
->Futures.catchingAsync(future, Throwable.class, fallback, MoreExecutors.directExecutor())
Objects.toStringHelper
and overloads: This requires us to define a duplicate ofMoreObjects$ToStringHelper
which is a bit more involved. Unclear precisely how this would work.Iterators.emptyIterator()
signature returns theUnmodifiableIterator
type, should be trivial to handle.- Many, many more.