PCloud63514 opened a new pull request, #7994:
URL: https://github.com/apache/gravitino/pull/7994
### What changes were proposed in this pull request?
Update `ConfigEntry` sequence parsing to:
- Trim leading/trailing whitespace for the input and each element
- Ignore empty/blank elements after trimming
- Preserve element order and duplicates
- Update tests accordingly (add parsing tests, remove obsolete empty-element
failure, verify `checkValue` runs after parsing)
### Why are the changes needed?
- Issue #7980 requests trimming and skipping empty elements for
comma-separated configuration.
- Previous behavior kept empty strings, which could lead to unexpected
`IllegalArgumentException` and less ergonomic configuration.
- Previously, whitespace-only elements (e.g., `" "`) were preserved as empty
strings (`List.of("")`).
- This change removes such elements entirely, so `" "` now results in an
empty list (`List.of()`).
Fix: #7980
### Does this PR introduce _any_ user-facing change?
- Yes.
- Configurations that previously produced `List.of("")` for whitespace-only
values will now produce `List.of()`.
- This may affect code that differentiates between “list with an empty
string” and “empty list”.
### How was this patch tested?
- Added `testSequenceParsing_trimsAndIgnoresEmptyElements()` to the
`TestConfigEntryList` class.
- Added `testBlankOnlyInput_returnsEmptyList()` to the `TestConfigEntryList`
class.
- Added `testCheckValue_appliesAfterParsing()` to the `TestConfigEntryList`
class.
- Added `testSequenceParsing_preservesOrderAndDuplicates()` to the
`TestConfigEntryList` class.
- Updated `testCheckValue()` in the `TestConfigEntryList` class to remove
obsolete empty-element failure case.
--
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]