Change signature of RetryOperations.execute() regarding nullability
Due to lacking support in NullAway for the current arrangement, we are (perhaps temporarily) changing the signature of the execute() method in RetryOperations (and thus also in RetryTemplate)... from: <R extends @Nullable Object> R execute(Retryable<R> retryable); to: <R> @Nullable R execute(Retryable<? extends @Nullable R> retryable); Once https://github.com/uber/NullAway/issues/1075 has been resolved, we will consider switching back to the original signature. See gh-34716
This commit is contained in:
@@ -41,6 +41,6 @@ public interface RetryOperations {
|
||||
* encountered during retry attempts should be made available as suppressed
|
||||
* exceptions
|
||||
*/
|
||||
<R extends @Nullable Object> R execute(Retryable<R> retryable) throws RetryException;
|
||||
<R> @Nullable R execute(Retryable<? extends @Nullable R> retryable) throws RetryException;
|
||||
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public class RetryTemplate implements RetryOperations {
|
||||
* encountered during retry attempts are available as suppressed exceptions
|
||||
*/
|
||||
@Override
|
||||
public <R extends @Nullable Object> R execute(Retryable<R> retryable) throws RetryException {
|
||||
public <R> @Nullable R execute(Retryable<? extends @Nullable R> retryable) throws RetryException {
|
||||
String retryableName = retryable.getName();
|
||||
// Initial attempt
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user