Skip to content

Commit 1f35491

Browse files
fix: SpotBugs errors
1 parent bed46a3 commit 1f35491

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/main/java/com/amazonaws/secretsmanager/caching/SecretCache.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ public String getSecretString(final String secretId) {
140140
* Retrieve and cache a secret string from AWS Secrets Manager.
141141
*
142142
* @param secretId the secret ID of the desired secret.
143-
* @param versionId the version ID of the desired secret (optional, can be <c>null</c>).
144-
* @param versionStage the version stage of the desired secret (optional, can be <c>null</c>).
143+
* @param versionId the version ID of the desired secret (optional, can be null).
144+
* @param versionStage the version stage of the desired secret (optional, can be null).
145145
*
146146
* @return The secret string for the desired secret.
147147
*/
@@ -175,8 +175,8 @@ public ByteBuffer getSecretBinary(final String secretId) {
175175
* Retrieve and cache a secret binary from AWS Secrets Manager.
176176
*
177177
* @param secretId the secret ID of the desired secret.
178-
* @param versionId the version ID of the desired secret (optional, can be <c>null</c>).
179-
* @param versionStage the version stage of the desired secret (optional, can be <c>null</c>).
178+
* @param versionId the version ID of the desired secret (optional, can be null).
179+
* @param versionStage the version stage of the desired secret (optional, can be null).
180180
*
181181
* @return The secret binary for the desired secret.
182182
*/

src/main/java/com/amazonaws/secretsmanager/caching/cache/SecretCacheItem.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private SecretCacheVersion getVersion(DescribeSecretResponse describeResponse, S
132132
continue;
133133
}
134134

135-
if (versionId != null && entry.getKey() == versionId) {
135+
if (versionId != null && versionId.equals(entry.getKey())) {
136136
currentVersionId = Optional.of(versionId);
137137
break;
138138
}
@@ -174,8 +174,8 @@ protected GetSecretValueResponse getSecretValue(DescribeSecretResponse describeR
174174
* Return the cached GetSecretValue result.
175175
*
176176
* @param describeResponse the DescribeSecret result.
177-
* @param versionId the version ID of the desired secret (optional, can be <c>null</c>).
178-
* @param versionStage the version stage of the desired secret (optional, can be <c>null</c>).
177+
* @param versionId the version ID of the desired secret (optional, can be null).
178+
* @param versionStage the version stage of the desired secret (optional, can be null).
179179
*
180180
* @return The cached GetSecretValue result.
181181
*/

src/main/java/com/amazonaws/secretsmanager/caching/cache/SecretCacheObject.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ public SecretCacheObject(final String secretId,
115115
* Execute the actual refresh of the cached secret state.
116116
*
117117
* @param result the GetSecretValue or DescribeSecret result.
118-
* @param versionId the version ID of the desired secret (optional, can be <c>null</c>).
119-
* @param versionStage the version stage of the desired secret (optional, can be <c>null</c>).
118+
* @param versionId the version ID of the desired secret (optional, can be null).
119+
* @param versionStage the version stage of the desired secret (optional, can be null).
120120
*
121121
* @return The cached GetSecretValue result based on the current cached state.
122122
*/
@@ -260,8 +260,8 @@ public GetSecretValueResponse getSecretValue() {
260260
/**
261261
* Return the cached GetSecretValue result.
262262
*
263-
* @param versionId the version ID of the desired secret (optional, can be <c>null</c>).
264-
* @param versionStage the version stage of the desired secret (optional, can be <c>null</c>).
263+
* @param versionId the version ID of the desired secret (optional, can be null).
264+
* @param versionStage the version stage of the desired secret (optional, can be null).
265265
*
266266
* @return The cached GetSecretValue result.
267267
*/

src/main/java/com/amazonaws/secretsmanager/caching/cache/SecretCacheVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ protected GetSecretValueResponse getSecretValue(GetSecretValueResponse gsvResult
102102
* Return the cached GetSecretValue result.
103103
*
104104
* @param gsvResult the GetSecretValue or DescribeSecret result.
105-
* @param versionId the version ID of the desired secret (optional, can be <c>null</c>).
106-
* @param versionStage the version stage of the desired secret (optional, can be <c>null</c>).
105+
* @param versionId the version ID of the desired secret (optional, can be null).
106+
* @param versionStage the version stage of the desired secret (optional, can be null).
107107
*
108108
* @return The cached GetSecretValue result.
109109
*/

0 commit comments

Comments
 (0)