You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "AliasJeff (via GitHub)" <gi...@apache.org> on 2026/08/16 06:04:36 UTC

[PR] Trim config values before biding properties to objects [rocketmq]

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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org