Skip to content

Commit

Permalink
Making sameThreadScheduledExecutor's return type ListeningScheduledEx…
Browse files Browse the repository at this point in the history
…ecutorService, 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
  • Loading branch information
java-team-github-bot authored and Google Java Core Libraries committed Nov 15, 2022
1 parent 6d7e326 commit dafaa3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public static ListeningScheduledExecutorService noOpScheduledExecutor() {
* invokeAll/invokeAny} throwing RejectedExecutionException, although a subset of the tasks may
* already have been executed.
*
* @since 15.0
* @since NEXT (taking the place of a method with a different return type from 15.0)
*/
public static SameThreadScheduledExecutorService sameThreadScheduledExecutor() {
public static ListeningScheduledExecutorService sameThreadScheduledExecutor() {
return new SameThreadScheduledExecutorService();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public static ListeningScheduledExecutorService noOpScheduledExecutor() {
* invokeAll/invokeAny} throwing RejectedExecutionException, although a subset of the tasks may
* already have been executed.
*
* @since 15.0
* @since NEXT (taking the place of a method with a different return type from 15.0)
*/
public static SameThreadScheduledExecutorService sameThreadScheduledExecutor() {
public static ListeningScheduledExecutorService sameThreadScheduledExecutor() {
return new SameThreadScheduledExecutorService();
}

Expand Down

0 comments on commit dafaa3e

Please sign in to comment.