PCloud63514 opened a new pull request, #8317:
URL: https://github.com/apache/gravitino/pull/8317
### What changes were proposed in this pull request?
- Add explicit validation for null and blank prefix in
RandomNameUtils.genRandomName
- Throw IllegalArgumentException when prefix is invalid
- Add unit tests for null and blank cases
- Add test ensuring generated names start with given prefix
### Why are the changes needed?
- Although NPE does not occur with current string concatenation, invalid
input should be rejected explicitly.
- This change enforces input validation and aligns with the issue’s
intention.
Fix: #8299
### Does this PR introduce _any_ user-facing change?
- RandomNameUtils.genRandomName throws IllegalArgumentException
when the prefix is null or blank.
### How was this patch tested?
- Added new tests in TestRandomNameUtils:
- testNullPrefixThrowsIllegalArgumentException
- testBlankPrefixThrowsIllegalArgumentException
- testGeneratedNameStartsWithPrefix
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]