Skip to content

Commit 8a60af2

Browse files
fix: SpotBugs errors
1 parent 6f30fe1 commit 8a60af2

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
@@ -122,8 +122,8 @@ public SecretCacheObject(final String secretId,
122122
* Execute the actual refresh of the cached secret state.
123123
*
124124
* @param result the GetSecretValue or DescribeSecret result.
125-
* @param versionId the version ID of the desired secret (optional, can be <c>null</c>).
126-
* @param versionStage the version stage of the desired secret (optional, can be <c>null</c>).
125+
* @param versionId the version ID of the desired secret (optional, can be null).
126+
* @param versionStage the version stage of the desired secret (optional, can be null).
127127
*
128128
* @return The cached GetSecretValue result based on the current cached state.
129129
*/
@@ -266,8 +266,8 @@ public GetSecretValueResponse getSecretValue() {
266266
/**
267267
* Return the cached GetSecretValue result.
268268
*
269-
* @param versionId the version ID of the desired secret (optional, can be <c>null</c>).
270-
* @param versionStage the version stage of the desired secret (optional, can be <c>null</c>).
269+
* @param versionId the version ID of the desired secret (optional, can be null).
270+
* @param versionStage the version stage of the desired secret (optional, can be null).
271271
*
272272
* @return The cached GetSecretValue result.
273273
*/

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)