Closed mindfocus closed 1 week ago
Hi @mindfocus, welcome to SOFAStack community, Please sign Contributor License Agreement!
After you signed CLA, we will automatically sync the status of this pull request in 3 minutes.
The overall change enhances the Configuration
class's parse
method to trim input strings, ensuring better handling of whitespace. Additionally, a new test method testToStringParseWithSpace
is added to the ConfigurationTest
to verify the functionality of parsing configuration strings with spaces.
File Path | Change Summary |
---|---|
.../jraft/conf/Configuration.java |
Modified the parse method to trim peerStr before parsing. |
.../jraft/conf/ConfigurationTest.java |
Added a new test method testToStringParseWithSpace to test parsing a configuration string with spaces. |
sequenceDiagram
participant Client
participant Configuration
participant StringUtils
Client->>Configuration: Call parse(conf)
Configuration->>StringUtils: StringUtils.trim(peerStr)
StringUtils-->>Configuration: Returns trimmed peerStr
Configuration->>Peer: peer.parse(trimmed peerStr)
Peer-->>Configuration: Returns parse result
Configuration-->>Client: Returns from parse method
In the land where code does hum,
Strings are trimmed, all are welcome,
Parsing cleanly with a grace,
New tests added, just in case.
A rabbit cheers with joyful cheer,
For code made clear, we’re engineers here!
🌟✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
CI failed @mindfocus
@fengjiachun fixed.
Motivation:
trim peerstr,使其更健壮?
Modification:
trim peerstr,使其更健壮?
Result:
Fixes #.
If there is no issue then describe the changes introduced by this PR.
Summary by CodeRabbit
Bug Fixes
Tests