From 18a696ad8948d966b5b0d0302551c39a49a8f543 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Wed, 18 Jan 2023 07:16:48 -0800 Subject: [PATCH] Document ForwardingExecutorService behavior for default methods. Currently, Guava is built with Java 9 and `ExecutorService` has no default methods. This changes in Java 19, where `ExecutorService.close` is added. Ensure users have right expectations about future evolution of the `ForwardingExecutorService` and its compatibility with newer Java versions. Fixes #6296 Fixes #6299 RELNOTES=n/a PiperOrigin-RevId: 502868842 --- .../common/util/concurrent/ForwardingExecutorService.java | 4 ++++ .../util/concurrent/ForwardingListeningExecutorService.java | 4 ++++ .../common/util/concurrent/ForwardingExecutorService.java | 4 ++++ .../util/concurrent/ForwardingListeningExecutorService.java | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/android/guava/src/com/google/common/util/concurrent/ForwardingExecutorService.java b/android/guava/src/com/google/common/util/concurrent/ForwardingExecutorService.java index 9a87b5c981ad..e9a1c4ec0a4f 100644 --- a/android/guava/src/com/google/common/util/concurrent/ForwardingExecutorService.java +++ b/android/guava/src/com/google/common/util/concurrent/ForwardingExecutorService.java @@ -33,6 +33,10 @@ * should override one or more methods to modify the behavior of the backing executor service as * desired per the decorator pattern. * + *

{@code default} method warning: This class does not forward calls to {@code + * default} methods. Instead, it inherits their default implementations. When those implementations + * invoke methods, they invoke methods on the {@code ForwardingExecutorService}. + * * @author Kurt Alfred Kluever * @since 10.0 */ diff --git a/android/guava/src/com/google/common/util/concurrent/ForwardingListeningExecutorService.java b/android/guava/src/com/google/common/util/concurrent/ForwardingListeningExecutorService.java index 592a9f5eed74..47f7b1d5d235 100644 --- a/android/guava/src/com/google/common/util/concurrent/ForwardingListeningExecutorService.java +++ b/android/guava/src/com/google/common/util/concurrent/ForwardingListeningExecutorService.java @@ -24,6 +24,10 @@ * executor service as desired per the decorator pattern. * + *

{@code default} method warning: This class does not forward calls to {@code + * default} methods. Instead, it inherits their default implementations. When those implementations + * invoke methods, they invoke methods on the {@code ForwardingListeningExecutorService}. + * * @author Isaac Shum * @since 10.0 */ diff --git a/guava/src/com/google/common/util/concurrent/ForwardingExecutorService.java b/guava/src/com/google/common/util/concurrent/ForwardingExecutorService.java index 9a87b5c981ad..e9a1c4ec0a4f 100644 --- a/guava/src/com/google/common/util/concurrent/ForwardingExecutorService.java +++ b/guava/src/com/google/common/util/concurrent/ForwardingExecutorService.java @@ -33,6 +33,10 @@ * should override one or more methods to modify the behavior of the backing executor service as * desired per the decorator pattern. * + *

{@code default} method warning: This class does not forward calls to {@code + * default} methods. Instead, it inherits their default implementations. When those implementations + * invoke methods, they invoke methods on the {@code ForwardingExecutorService}. + * * @author Kurt Alfred Kluever * @since 10.0 */ diff --git a/guava/src/com/google/common/util/concurrent/ForwardingListeningExecutorService.java b/guava/src/com/google/common/util/concurrent/ForwardingListeningExecutorService.java index 592a9f5eed74..47f7b1d5d235 100644 --- a/guava/src/com/google/common/util/concurrent/ForwardingListeningExecutorService.java +++ b/guava/src/com/google/common/util/concurrent/ForwardingListeningExecutorService.java @@ -24,6 +24,10 @@ * executor service as desired per the decorator pattern. * + *

{@code default} method warning: This class does not forward calls to {@code + * default} methods. Instead, it inherits their default implementations. When those implementations + * invoke methods, they invoke methods on the {@code ForwardingListeningExecutorService}. + * * @author Isaac Shum * @since 10.0 */