From 0a4df9f93cdb4586e529e32c08eb97b92c514882 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Wed, 5 Jun 2024 09:55:08 -0700 Subject: [PATCH] binder: Make transport notification methods package-private These are overrides of BinderTransport itself, so not used elsewhere. They are essentially private. It was scary seeing `@GuardedBy` for a public method. I copied the annotation to the base class to make sure ErrorProne could verify the calls. --- .../java/io/grpc/binder/internal/BinderTransport.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/binder/src/main/java/io/grpc/binder/internal/BinderTransport.java b/binder/src/main/java/io/grpc/binder/internal/BinderTransport.java index f073648ca2..9deb2bfaea 100644 --- a/binder/src/main/java/io/grpc/binder/internal/BinderTransport.java +++ b/binder/src/main/java/io/grpc/binder/internal/BinderTransport.java @@ -260,8 +260,10 @@ public abstract class BinderTransport return !flowController.isTransmitWindowFull(); } + @GuardedBy("this") abstract void notifyShutdown(Status shutdownStatus); + @GuardedBy("this") abstract void notifyTerminated(); void releaseExecutors() { @@ -720,13 +722,13 @@ public abstract class BinderTransport @Override @GuardedBy("this") - public void notifyShutdown(Status status) { + void notifyShutdown(Status status) { clientTransportListener.transportShutdown(status); } @Override @GuardedBy("this") - public void notifyTerminated() { + void notifyTerminated() { if (numInUseStreams.getAndSet(0) > 0) { clientTransportListener.transportInUse(false); } @@ -897,13 +899,13 @@ public abstract class BinderTransport @Override @GuardedBy("this") - public void notifyShutdown(Status status) { + void notifyShutdown(Status status) { // Nothing to do. } @Override @GuardedBy("this") - public void notifyTerminated() { + void notifyTerminated() { if (serverTransportListener != null) { serverTransportListener.transportTerminated(); }