Skip to content

Commit b28b307

Browse files
committed
Make ExceptionHandler conform with our code style
1 parent d026540 commit b28b307

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

gcloud-java-core/src/main/java/com/google/gcloud/ExceptionHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ void verifyCaller(Callable<?> callable) {
231231
}
232232
}
233233

234-
public Set<Class<? extends Exception>> getRetriableExceptions() {
234+
public Set<Class<? extends Exception>> retriableExceptions() {
235235
return retriableExceptions;
236236
}
237237

238-
public Set<Class<? extends Exception>> getNonRetriableExceptions() {
238+
public Set<Class<? extends Exception>> nonRetriableExceptions() {
239239
return nonRetriableExceptions;
240240
}
241241

@@ -262,7 +262,7 @@ boolean shouldRetry(Exception ex) {
262262
/**
263263
* Returns an instance which retry any checked exception and abort on any runtime exception.
264264
*/
265-
public static ExceptionHandler getDefaultInstance() {
265+
public static ExceptionHandler defaultInstance() {
266266
return DEFAULT_INSTANCE;
267267
}
268268

gcloud-java-core/src/main/java/com/google/gcloud/RetryHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private static long getExponentialValue(long initialDelay, double backoffFactor,
229229

230230
public static <V> V runWithRetries(Callable<V> callable) throws RetryHelperException {
231231
return runWithRetries(callable, RetryParams.defaultInstance(),
232-
ExceptionHandler.getDefaultInstance());
232+
ExceptionHandler.defaultInstance());
233233
}
234234

235235
public static <V> V runWithRetries(Callable<V> callable, RetryParams params,

gcloud-java-core/src/test/java/com/google/gcloud/ExceptionHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public Object call() throws Error {
8282
}
8383

8484
// using default exception handler (retry upon any non-runtime exceptions)
85-
ExceptionHandler handler = ExceptionHandler.getDefaultInstance();
85+
ExceptionHandler handler = ExceptionHandler.defaultInstance();
8686
assertValidCallable(new A(), handler);
8787
assertValidCallable(new B(), handler);
8888
assertValidCallable(new C(), handler);

gcloud-java-core/src/test/java/com/google/gcloud/RetryHelperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public void testTriesAtLeastMinTimes() {
124124
}
125125
return timesCalled;
126126
}
127-
}, params, ExceptionHandler.getDefaultInstance());
127+
}, params, ExceptionHandler.defaultInstance());
128128
assertEquals(timesToFail + 1, attempted);
129129
assertNull(RetryHelper.getContext());
130130
}

0 commit comments

Comments
 (0)