Skip to content

Commit

Permalink
Fix NPE in RetryPolicy.hashCode() (#2672)
Browse files Browse the repository at this point in the history
  • Loading branch information
dagnir authored Aug 23, 2021
1 parent e964b1c commit be56f14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/next-release/bugfix-AWSSDKforJavav2-f2c1771.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"category": "AWS SDK for Java v2",
"contributor": "",
"type": "bugfix",
"description": "Fix `NullPointerException` in `RetryPolicy.hashCode()`."
}
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public int hashCode() {
result = 31 * result + Boolean.hashCode(additionalRetryConditionsAllowed);
result = 31 * result + backoffStrategy.hashCode();
result = 31 * result + throttlingBackoffStrategy.hashCode();
result = 31 * result + Boolean.hashCode(fastFailRateLimiting);
result = 31 * result + Objects.hashCode(fastFailRateLimiting);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,9 @@ public void fastFailRateLimitingConfigured_retryModeNotAdaptive_throws() {
public void fastFailRateLimitingConfigured_retryModeAdaptive_doesNotThrow() {
RetryPolicy.builder(RetryMode.ADAPTIVE).fastFailRateLimiting(true).build();
}

@Test
public void hashCodeDoesNotThrow() {
RetryPolicy.defaultRetryPolicy().hashCode();
}
}

0 comments on commit be56f14

Please sign in to comment.