Skip to content

Commit

Permalink
Clarify documentation of transform methods in ClosingFuture.
Browse files Browse the repository at this point in the history
From reading the documentation of (e.g.) `ClosingFuture#catching`, it seems a caller is not allowed to afterwards call (e.g.) `finishToValueAndCloser`, even though this is totally fine according to the class level documentation.

RELNOTES=Clarify documentation of transform methods in `ClosingFuture`
PiperOrigin-RevId: 572596268
  • Loading branch information
java-team-github-bot authored and Google Java Core Libraries committed Oct 11, 2023
1 parent 6736cad commit b3a1252
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ public ListenableFuture<?> statusFuture() {
*
* <p>After calling this method, you may not call {@link #finishToFuture()}, {@link
* #finishToValueAndCloser(ValueAndCloserConsumer, Executor)}, or any other derivation method on
* this {@code ClosingFuture}.
* the original {@code ClosingFuture} instance.
*
* @param function transforms the value of this step to the value of the derived step
* @param executor executor to run the function in
Expand Down Expand Up @@ -771,7 +771,7 @@ public String toString() {
*
* <p>After calling this method, you may not call {@link #finishToFuture()}, {@link
* #finishToValueAndCloser(ValueAndCloserConsumer, Executor)}, or any other derivation method on
* this {@code ClosingFuture}.
* the original {@code ClosingFuture} instance.
*
* @param function transforms the value of this step to a {@code ClosingFuture} with the value of
* the derived step
Expand Down Expand Up @@ -862,7 +862,7 @@ public ClosingFuture<U> apply(DeferredCloser closer, V input) throws Exception {
*
* <p>After calling this method, you may not call {@link #finishToFuture()}, {@link
* #finishToValueAndCloser(ValueAndCloserConsumer, Executor)}, or any other derivation method on
* this {@code ClosingFuture}.
* the original {@code ClosingFuture} instance.
*
* @param exceptionType the exception type that triggers use of {@code fallback}. The exception
* type is matched against this step's exception. "This step's exception" means the cause of
Expand Down Expand Up @@ -955,7 +955,7 @@ public String toString() {
*
* <p>After calling this method, you may not call {@link #finishToFuture()}, {@link
* #finishToValueAndCloser(ValueAndCloserConsumer, Executor)}, or any other derivation method on
* this {@code ClosingFuture}.
* the original {@code ClosingFuture} instance.
*
* @param exceptionType the exception type that triggers use of {@code fallback}. The exception
* type is matched against this step's exception. "This step's exception" means the cause of
Expand Down Expand Up @@ -1012,7 +1012,7 @@ public String toString() {
*
* <p>After calling this method, you may not call {@link
* #finishToValueAndCloser(ValueAndCloserConsumer, Executor)}, this method, or any other
* derivation method on this {@code ClosingFuture}.
* derivation method on the original {@code ClosingFuture} instance.
*
* @return a {@link Future} that represents the final value or exception of the pipeline
*/
Expand Down Expand Up @@ -1057,7 +1057,7 @@ public void run() {
* receiver can store the {@link ValueAndCloser} outside the receiver for later synchronous use.
*
* <p>After calling this method, you may not call {@link #finishToFuture()}, this method again, or
* any other derivation method on this {@code ClosingFuture}.
* any other derivation method on the original {@code ClosingFuture} instance.
*
* @param consumer a callback whose method will be called (using {@code executor}) when this
* operation is done
Expand Down
12 changes: 6 additions & 6 deletions guava/src/com/google/common/util/concurrent/ClosingFuture.java
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ public ListenableFuture<?> statusFuture() {
*
* <p>After calling this method, you may not call {@link #finishToFuture()}, {@link
* #finishToValueAndCloser(ValueAndCloserConsumer, Executor)}, or any other derivation method on
* this {@code ClosingFuture}.
* the original {@code ClosingFuture} instance.
*
* @param function transforms the value of this step to the value of the derived step
* @param executor executor to run the function in
Expand Down Expand Up @@ -774,7 +774,7 @@ public String toString() {
*
* <p>After calling this method, you may not call {@link #finishToFuture()}, {@link
* #finishToValueAndCloser(ValueAndCloserConsumer, Executor)}, or any other derivation method on
* this {@code ClosingFuture}.
* the original {@code ClosingFuture} instance.
*
* @param function transforms the value of this step to a {@code ClosingFuture} with the value of
* the derived step
Expand Down Expand Up @@ -865,7 +865,7 @@ public ClosingFuture<U> apply(DeferredCloser closer, V input) throws Exception {
*
* <p>After calling this method, you may not call {@link #finishToFuture()}, {@link
* #finishToValueAndCloser(ValueAndCloserConsumer, Executor)}, or any other derivation method on
* this {@code ClosingFuture}.
* the original {@code ClosingFuture} instance.
*
* @param exceptionType the exception type that triggers use of {@code fallback}. The exception
* type is matched against this step's exception. "This step's exception" means the cause of
Expand Down Expand Up @@ -958,7 +958,7 @@ public String toString() {
*
* <p>After calling this method, you may not call {@link #finishToFuture()}, {@link
* #finishToValueAndCloser(ValueAndCloserConsumer, Executor)}, or any other derivation method on
* this {@code ClosingFuture}.
* the original {@code ClosingFuture} instance.
*
* @param exceptionType the exception type that triggers use of {@code fallback}. The exception
* type is matched against this step's exception. "This step's exception" means the cause of
Expand Down Expand Up @@ -1015,7 +1015,7 @@ public String toString() {
*
* <p>After calling this method, you may not call {@link
* #finishToValueAndCloser(ValueAndCloserConsumer, Executor)}, this method, or any other
* derivation method on this {@code ClosingFuture}.
* derivation method on the original {@code ClosingFuture} instance.
*
* @return a {@link Future} that represents the final value or exception of the pipeline
*/
Expand Down Expand Up @@ -1060,7 +1060,7 @@ public void run() {
* receiver can store the {@link ValueAndCloser} outside the receiver for later synchronous use.
*
* <p>After calling this method, you may not call {@link #finishToFuture()}, this method again, or
* any other derivation method on this {@code ClosingFuture}.
* any other derivation method on the original {@code ClosingFuture} instance.
*
* @param consumer a callback whose method will be called (using {@code executor}) when this
* operation is done
Expand Down

0 comments on commit b3a1252

Please sign in to comment.