beautyarbutin opened a new pull request, #11210:
URL: https://github.com/apache/rocketmq/pull/11210

   ### Which Issue(s) This PR Fixes
   
   - Fixes #10835
   
   ### Brief Description
   
   `TopicConfig.decode()` previously assigned `topicName` before parsing the 
mandatory numeric and enum fields. Invalid input could therefore throw and 
leave the existing object partially mutated.
   
   Parse all mandatory fields into local variables first, return `false` on 
invalid numeric or filter-type values, and update the object only after all 
mandatory fields are valid. Regression coverage verifies truncated input and 
each invalid mandatory field while comparing the complete original object state.
   
   This follows up on #10845, which was closed without being merged.
   
   ### How Did You Test This Change?
   
   - `mvn -B -ntp -pl common clean -DskipITs -Dtest=TopicConfigTest 
-Dspotbugs.skip=true test`
   - `TopicConfigTest`: 4 tests passed
   - Checkstyle: 0 violations


-- 
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]

Reply via email to