ListenableFuture.addListener Javadoc mistake?

59 views
Skip to first unread message

Gerrit

unread,
Jul 16, 2013, 8:49:26 AM7/16/13
to guava-...@googlegroups.com
Guava 14.0.1's ListenableFuture.addListener(..) Javadoc states the following:

  • If the input Future is done at the time addListener is called, addListener will execute the listener inline.
  • If the input Future is not yet done, addListener will schedule the listener to be run by the thread that completes the input Future, which may be an internal system thread such as an RPC network thread.

Hm, there is no "input" Future for this particular method. Maybe these statements were copied-and-pasted from some other source? Because those "input Future" statements are also used e.g. for Futures.addCallback(..) and Futures.transform(..) where they do make sense to me (... and for the transform(..) methods, the method parameter is called "input").

For ListenableFuture.addListener(..), maybe instead these statements should say "If this Future is...."?

In case those "input Future" statements do also make sense for ListenableFuture.addListener(..), I'd be nice to give some clarification what they mean.

Chris Povirk

unread,
Jul 17, 2013, 1:19:51 PM7/17/13
to Gerrit, guava-discuss
Thanks for the report. You are correct about the copy-and-paste
problem. We'll take care of this. If you'd like to track it more
closely, you could file a bug, but I'll get it either way.

Gerrit

unread,
Jul 17, 2013, 1:59:06 PM7/17/13
to guava-...@googlegroups.com, Gerrit
Reply all
Reply to author
Forward
0 new messages