Skip to content

Commit dafaa3e

Browse files
java-team-github-botGoogle Java Core Libraries
authored and
Google Java Core Libraries
committedNov 15, 2022
Making sameThreadScheduledExecutor's return type ListeningScheduledExecutorService, to avoid leaking a package-private class through a public method.
RELNOTES=`testing`: Changed the return type of `sameThreadScheduledExecutor` to `ListeningScheduledExecutorService` to avoid leaking a package-private class through a public method. This helps Kotlin callers. PiperOrigin-RevId: 488662036
1 parent 6d7e326 commit dafaa3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎android/guava-testlib/src/com/google/common/util/concurrent/testing/TestingExecutors.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ public static ListeningScheduledExecutorService noOpScheduledExecutor() {
8888
* invokeAll/invokeAny} throwing RejectedExecutionException, although a subset of the tasks may
8989
* already have been executed.
9090
*
91-
* @since 15.0
91+
* @since NEXT (taking the place of a method with a different return type from 15.0)
9292
*/
93-
public static SameThreadScheduledExecutorService sameThreadScheduledExecutor() {
93+
public static ListeningScheduledExecutorService sameThreadScheduledExecutor() {
9494
return new SameThreadScheduledExecutorService();
9595
}
9696

‎guava-testlib/src/com/google/common/util/concurrent/testing/TestingExecutors.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ public static ListeningScheduledExecutorService noOpScheduledExecutor() {
8888
* invokeAll/invokeAny} throwing RejectedExecutionException, although a subset of the tasks may
8989
* already have been executed.
9090
*
91-
* @since 15.0
91+
* @since NEXT (taking the place of a method with a different return type from 15.0)
9292
*/
93-
public static SameThreadScheduledExecutorService sameThreadScheduledExecutor() {
93+
public static ListeningScheduledExecutorService sameThreadScheduledExecutor() {
9494
return new SameThreadScheduledExecutorService();
9595
}
9696

0 commit comments

Comments
 (0)