question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regarding splitting away `ListenableFuture` from Guava

See original GitHub issue

This issue is a follow-on from the discussion started by @jodastephen at https://github.com/google/guava/issues/3302#issuecomment-435836131 about the recent introduction of the com.google.guava:listenablefuture and com.google.guava:failureaccess dependencies.

To summarise, when @cpovirk is back from leave, I’d love to hear his reasoning for the introduction of the two new artifacts, and to discuss things (whether publicly or privately) with both @cpovirk and @jodastephen to see if it would be possible to achieve what the Android Support library authors would like (being able to use ListenableFuture in the Android SDK, IIUC) whilst satisfying @jodastephen and myself (keeping Guava as one artifact, or as close to this as possible).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:37 (23 by maintainers)

github_iconTop GitHub Comments

62reactions
jodastephencommented, Nov 21, 2018

As it stands, I have no desire to upgrade Guava beyond v26, which could be a problem if there is a security issue.

In OpenGamma Strata, we have to list all dependencies (including transient), so the new setup (particularly the v9999 hack) is problematic (just try explaining it!).

In Joda-Collect, this change triples the number of dependencies. Things are not much different in Joda-Beans and Joda-Convert.

My proposal is that Guava v28-jre has no dependencies, but v28-android does. From a quick look at the code, I don’t see why that wouldn’t work.

12reactions
jodastephencommented, Jan 14, 2019

Thank you for responding. Unfortunately, it doesn’t really provide a route forward for those of us that care about dependencies (and find the 9999 hack completely unacceptable). As it stands, we are stuck on v26.

And the benefits are smaller, likely even zero

No, the benefits are not zero, they are negative.

I have to stress again, dependency count is really important for libraries, and especially low level ones because each dependency added has a multiplier effect up the stack. Ultimately, each dependency that a library has increases the chance of jar hell for someone in the large-systems you discuss. Developers like me are trying to reduce and minimize the pain for large-systems, changes like this really don’t help.

I’ll ask again, why not make v28-jre a single jar, while the android release is split? The jre release is Java 8+, where CompletableFuture provides what many would argue is a superset of the benefits of ListenableFuture (thus making it a complete irrelevance to break out ListenableFuture into a separate jar).

However this thread ends, it does feel like Guava has damaged the trust that allowed it to be effectively an extension to the JDK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Guava's Futures and ListenableFuture - Baeldung
Future is the ability to add listeners to run on completion, which is a common feature provided by most popular asynchronous frameworks. Guava...
Read more >
Plans for a separate artifact containing only ListenableFuture
Any specific reason you don't "simply" move ListenableFuture out of Guava and make Guava depend on the new artifact? No duplicate class without...
Read more >
How to properly deal with exceptions coming ... - Stack Overflow
I assume you're using Spring 4 (AsyncRestTemplate). In this case ListenableFuture that you get is not really Guava's ListenableFuture, ...
Read more >
Why is it considered bad that Guava introduced direct, internal ...
The solution they have implemented is to split the class out into a library. Which can then be used by both. But this...
Read more >
Deprecated List (Guava: Google Core Libraries for Java 11.0 ...
This class is scheduled for deletion from Guava in Guava release 12.0. ... This method has been split out into the LoadingCache interface, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found