File tree Expand file tree Collapse file tree
sdk-platform-java/gax-java/gax/src
main/java/com/google/api/gax/retrying
test/java/com/google/api/gax/retrying Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -232,14 +232,17 @@ public boolean shouldRetry(
232232 ResponseT previousResponse ,
233233 TimedAttemptSettings nextAttemptSettings )
234234 throws CancellationException {
235- boolean retryBasedOnResult = shouldRetryBasedOnResult (context , previousThrowable , previousResponse );
235+ boolean retryBasedOnResult =
236+ shouldRetryBasedOnResult (context , previousThrowable , previousResponse );
236237
237- // Short-circuit when operation has succeeded to avoid erroneously throwing CancellationException below
238+ // Short-circuit when operation has succeeded to avoid erroneously throwing
239+ // CancellationException below
238240 if (!retryBasedOnResult && previousThrowable == null ) {
239241 return false ;
240242 }
241243
242- boolean retryBasedOnTiming = shouldRetryBasedOnTiming (context , nextAttemptSettings ); // throws CancellationException
244+ // throws CancellationException
245+ boolean retryBasedOnTiming = shouldRetryBasedOnTiming (context , nextAttemptSettings );
243246 return retryBasedOnResult && retryBasedOnTiming ;
244247 }
245248
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ void testShouldRetryWithContext_noPreviousSettings() {
204204 }
205205
206206 @ Test
207- void testShouldRetry_prevThrowableNotNull_shouldRetryBasedOnResultFalse_callsTimedAlgorithm () {
207+ void testShouldRetry_resultFalseAndThrowableNotNull_callsTimed () {
208208 ResultRetryAlgorithm <Object > resultAlgorithm = mock (ResultRetryAlgorithm .class );
209209 TimedRetryAlgorithm timedAlgorithm = mock (TimedRetryAlgorithm .class );
210210 RetryAlgorithm <Object > algorithm = new RetryAlgorithm <>(resultAlgorithm , timedAlgorithm );
@@ -219,7 +219,7 @@ void testShouldRetry_prevThrowableNotNull_shouldRetryBasedOnResultFalse_callsTim
219219 }
220220
221221 @ Test
222- void testShouldRetry_prevThrowableNull_shouldRetryBasedOnResultFalse_shortCircuits () {
222+ void testShouldRetry_resultFalseAndThrowableNull_shortCircuits () {
223223 ResultRetryAlgorithm <Object > resultAlgorithm = mock (ResultRetryAlgorithm .class );
224224 TimedRetryAlgorithm timedAlgorithm = mock (TimedRetryAlgorithm .class );
225225 RetryAlgorithm <Object > algorithm = new RetryAlgorithm <>(resultAlgorithm , timedAlgorithm );
You can’t perform that action at this time.
0 commit comments