From 17c41c967d37603b7b085fbacf9160b34e62d0ad Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 24 Jul 2025 08:39:42 -0700 Subject: [PATCH] end -> endNanoTime --- .../java/io/grpc/stub/BlockingClientCall.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/stub/src/main/java/io/grpc/stub/BlockingClientCall.java b/stub/src/main/java/io/grpc/stub/BlockingClientCall.java index 910aaffeec..b62bd4322a 100644 --- a/stub/src/main/java/io/grpc/stub/BlockingClientCall.java +++ b/stub/src/main/java/io/grpc/stub/BlockingClientCall.java @@ -106,14 +106,14 @@ public final class BlockingClientCall { */ public RespT read(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, StatusException { - long end = System.nanoTime() + unit.toNanos(timeout); - return read(false, end); + long endNanoTime = System.nanoTime() + unit.toNanos(timeout); + return read(false, endNanoTime); } - private RespT read(boolean waitForever, long end) + private RespT read(boolean waitForever, long endNanoTime) throws InterruptedException, TimeoutException, StatusException { Predicate> predicate = BlockingClientCall::skipWaitingForRead; - executor.waitAndDrainWithTimeout(waitForever, end, predicate, this); + executor.waitAndDrainWithTimeout(waitForever, endNanoTime, predicate, this); RespT bufferedValue = buffer.poll(); if (logger.isLoggable(Level.FINER)) { @@ -209,11 +209,11 @@ public final class BlockingClientCall { */ public boolean write(ReqT request, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, StatusException { - long end = System.nanoTime() + unit.toNanos(timeout); - return write(false, request, end); + long endNanoTime = System.nanoTime() + unit.toNanos(timeout); + return write(false, request, endNanoTime); } - private boolean write(boolean waitForever, ReqT request, long end) + private boolean write(boolean waitForever, ReqT request, long endNanoTime) throws InterruptedException, TimeoutException, StatusException { if (writeClosed) { @@ -222,7 +222,7 @@ public final class BlockingClientCall { Predicate> predicate = (x) -> x.call.isReady() || x.closedStatus != null; - executor.waitAndDrainWithTimeout(waitForever, end, predicate, this); + executor.waitAndDrainWithTimeout(waitForever, endNanoTime, predicate, this); Status savedClosedStatus = closedStatus; if (savedClosedStatus == null) { call.sendMessage(request);