Skip to content

Commit c74d5fa

Browse files
committed
Fix naming of shouldRefresh method
1 parent 87e46e5 commit c74d5fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

services/signin/src/main/java/software/amazon/awssdk/services/signin/auth/LoginCredentialsProvider.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ private RefreshResult<AwsCredentials> updateSigninCredentials() {
138138
() -> SdkClientException.create("Invalid token expiration time. You must re-authenticate.")
139139
);
140140

141-
if (shouldRefresh(currentExpirationTime, staleTime)
142-
&& shouldRefresh(currentExpirationTime, prefetchTime)) {
141+
if (shouldNotRefresh(currentExpirationTime, staleTime)
142+
&& shouldNotRefresh(currentExpirationTime, prefetchTime)) {
143143
log.debug(() -> "Using access token from disk, current expiration time is : " + currentExpirationTime);
144144
AwsCredentials credentials = tokenFromDisc.getAccessToken()
145145
.toBuilder()
@@ -241,9 +241,9 @@ public Builder toBuilder() {
241241

242242
/**
243243
*
244-
* @return true if the token should be refreshed (it is after the given refresh window, eg stale time or prefetch time)
244+
* @return true if the token does NOT need to be refreshed - it is after the given refresh window, eg stale/prefetch time.
245245
*/
246-
private static boolean shouldRefresh(Instant expiration, Duration refreshWindow) {
246+
private static boolean shouldNotRefresh(Instant expiration, Duration refreshWindow) {
247247
Instant now = Instant.now();
248248
return expiration.isAfter(now.plus(refreshWindow));
249249
}

0 commit comments

Comments
 (0)