Skip to content

Commit f648950

Browse files
committed
fix(gax): fix linter issues
1 parent 9647336 commit f648950

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/retrying/RetryAlgorithm.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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

sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/retrying/RetryAlgorithmTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)