AliasJeff opened a new pull request, #10948: URL: https://github.com/apache/rocketmq/pull/10948
## Which Issue(s) This PR Fixes #10708 ## Brief Description This PR trims property values before binding them to config objects in MixAll.properties2Object. Previously, only String values were trimmed. Numeric and boolean values were parsed as-is, so a value like fileReservedTime = 168 failed to parse and the config field kept its default value. This change trims the value before type conversion, so int, long, double, float, boolean, and String values are handled consistently. ## How Did You Test This Change? Added tests for: - primitive config values with leading/trailing whitespace; - fileReservedTime = 168 being parsed as 168 instead of keeping the default value. ## Test commands: ``` mvn -pl common -DskipITs -Dspotbugs.skip=true -Dcheckstyle.skip=true -Dlicense.skip=true -Dtest=org.apache.rocketmq.common.UtilAllTest#testProperties2ObjectTrimsPrimitiveValues test mvn -pl broker -am -DskipITs -Dspotbugs.skip=true -Dcheckstyle.skip=true -Dlicense.skip=true -DfailIfNoTests=false -Dtest=org.apache.rocketmq.broker.BrokerControllerTest#testFileReservedTimeWithTrailingWhitespaceIsPreserved test ``` Both targeted tests passed locally. -- 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]
