From 1c9efd6a0f77ac71bceac2f93ea487d3d5d9258c Mon Sep 17 00:00:00 2001 From: cpovirk Date: Wed, 18 Jan 2023 03:29:01 -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: 502827344 --- .../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 */