Skip to content

Commit 72630d8

Browse files
committed
S2AChannelPool returnChannel --> returnToPool name change.
1 parent 739ee23 commit 72630d8

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

s2a/src/main/java/io/grpc/s2a/channel/S2AChannelPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public interface S2AChannelPool extends AutoCloseable {
3232
Channel getChannel();
3333

3434
/** Returns a channel to the channel pool. */
35-
void returnChannel(Channel channel);
35+
void returnToPool(Channel channel);
3636

3737
/**
3838
* Returns all channels to the channel pool and closes the pool so that no new channels can be

s2a/src/main/java/io/grpc/s2a/channel/S2AGrpcChannelPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public synchronized Channel getChannel() {
8787
* <p>The caller must ensure that {@code channel} was retrieved from this channel pool.
8888
*/
8989
@Override
90-
public synchronized void returnChannel(Channel channel) {
90+
public synchronized void returnToPool(Channel channel) {
9191
checkState(state.equals(State.OPEN), "Channel pool is not open.");
9292
checkArgument(
9393
cachedChannel != null && numberOfUsersOfCachedChannel > 0 && cachedChannel.equals(channel),

s2a/src/test/java/io/grpc/s2a/channel/S2AGrpcChannelPoolTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,34 @@ public void getChannel_success() throws Exception {
4343
}
4444

4545
@Test
46-
public void returnChannel_success() throws Exception {
46+
public void returnToPool_success() throws Exception {
4747
FakeChannelPool fakeChannelPool = new FakeChannelPool();
4848
S2AChannelPool s2aChannelPool = S2AGrpcChannelPool.create(fakeChannelPool);
4949

50-
s2aChannelPool.returnChannel(s2aChannelPool.getChannel());
50+
s2aChannelPool.returnToPool(s2aChannelPool.getChannel());
5151

5252
assertThat(fakeChannelPool.isChannelCached()).isFalse();
5353
}
5454

5555
@Test
56-
public void returnChannel_channelStillCachedBecauseMultipleChannelsRetrieved() throws Exception {
56+
public void returnToPool_channelStillCachedBecauseMultipleChannelsRetrieved() throws Exception {
5757
FakeChannelPool fakeChannelPool = new FakeChannelPool();
5858
S2AChannelPool s2aChannelPool = S2AGrpcChannelPool.create(fakeChannelPool);
5959

6060
s2aChannelPool.getChannel();
61-
s2aChannelPool.returnChannel(s2aChannelPool.getChannel());
61+
s2aChannelPool.returnToPool(s2aChannelPool.getChannel());
6262

6363
assertThat(fakeChannelPool.isChannelCached()).isTrue();
6464
}
6565

6666
@Test
67-
public void returnChannel_failureBecauseChannelWasNotFromPool() throws Exception {
67+
public void returnToPool_failureBecauseChannelWasNotFromPool() throws Exception {
6868
S2AChannelPool s2aChannelPool = S2AGrpcChannelPool.create(new FakeChannelPool());
6969

7070
IllegalArgumentException expected =
7171
assertThrows(
7272
IllegalArgumentException.class,
73-
() -> s2aChannelPool.returnChannel(mock(Channel.class)));
73+
() -> s2aChannelPool.returnToPool(mock(Channel.class)));
7474
assertThat(expected)
7575
.hasMessageThat()
7676
.isEqualTo(

s2a/src/test/java/io/grpc/s2a/handshaker/S2AProtocolNegotiatorFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public Channel getChannel() {
187187
}
188188

189189
@Override
190-
public void returnChannel(Channel channel) {}
190+
public void returnToPool(Channel channel) {}
191191

192192
@Override
193193
public void close() {}

0 commit comments

Comments
 (0)