This is an automated email from the ASF dual-hosted git repository.
jmclean pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 27fdaee781 [#8511] improvement(core): add missing space in
CredentialCacheKey.toString() (#8515)
27fdaee781 is described below
commit 27fdaee7811f62ea0dae9991b78d1572d10982e1
Author: Khawaja Abdullah Ansar <[email protected]>
AuthorDate: Sat Sep 13 17:27:43 2025 +0500
[#8511] improvement(core): add missing space in
CredentialCacheKey.toString() (#8515)
### What changes were proposed in this pull request?
Added a missing space between the `credentialType` and
`credentialContext` fields in the `toString()` output of
`CredentialCacheKey`, improving its readability.
### Why are the changes needed?
The missing space made the string representation less readable and could
confuse debugging or log parsing. This fix ensures clear separation
between fields and improves developer experience while interpreting the
output.
Fix: #8511
### Does this PR introduce _any_ user-facing change?
Yes—minor formatting improvement seen in log outputs, error messages, or
any usage of `toString()` on `CredentialCacheKey`. No behavioral
changes.
### How was this patch tested?
- Added unit test to verify the spaced output in `toString()` includes
`"credentialType: <type> credentialContext:"`.
---
.../java/org/apache/gravitino/credential/CredentialCacheKey.java | 2 +-
.../org/apache/gravitino/credential/TestCredentialCacheKey.java | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git
a/core/src/main/java/org/apache/gravitino/credential/CredentialCacheKey.java
b/core/src/main/java/org/apache/gravitino/credential/CredentialCacheKey.java
index 635f530b07..cbe40d670d 100644
--- a/core/src/main/java/org/apache/gravitino/credential/CredentialCacheKey.java
+++ b/core/src/main/java/org/apache/gravitino/credential/CredentialCacheKey.java
@@ -57,7 +57,7 @@ public class CredentialCacheKey {
stringBuilder
.append("credentialType: ")
.append(credentialType)
- .append("credentialContext: ")
+ .append(" credentialContext: ")
.append(credentialContext);
return stringBuilder.toString();
}
diff --git
a/core/src/test/java/org/apache/gravitino/credential/TestCredentialCacheKey.java
b/core/src/test/java/org/apache/gravitino/credential/TestCredentialCacheKey.java
index b29c660a97..76e9deab77 100644
---
a/core/src/test/java/org/apache/gravitino/credential/TestCredentialCacheKey.java
+++
b/core/src/test/java/org/apache/gravitino/credential/TestCredentialCacheKey.java
@@ -53,4 +53,13 @@ public class TestCredentialCacheKey {
CredentialCacheKey key4 = new CredentialCacheKey("s3-token1", context);
Assertions.assertFalse(cache.contains(key4));
}
+
+ @Test
+ void testToStringContainsSpaceBetweenFields() {
+ PathBasedCredentialContext context =
+ new PathBasedCredentialContext("user", ImmutableSet.of(),
ImmutableSet.of());
+ CredentialCacheKey key = new CredentialCacheKey("s3-token", context);
+
+ Assertions.assertTrue(key.toString().contains("credentialType: s3-token
credentialContext:"));
+ }
}