gaoxiaolei-s59 opened a new pull request, #10459:
URL: https://github.com/apache/rocketmq/pull/10459

   ## What is the purpose of the change
   
   Fixes #10458
   
   `MessageBatch.generateFromList` used Java `assert` statements to validate 
null and empty input. That made invalid input behavior depend on assertion 
settings, producing `AssertionError` when assertions are enabled or later 
`NullPointerException` when they are disabled.
   
   This PR replaces the assertions with explicit `IllegalArgumentException` 
validation.
   
   ## Brief changelog
   
   - Validate null and empty message collections explicitly in 
`MessageBatch.generateFromList`
   - Add unit coverage for null and empty message collection inputs
   
   ## Verifying this change
   
   - `mvn -pl common -Dtest=MessageBatchTest -Dspotbugs.skip=true test`
   
   ## Note
   
   A full `mvn -pl common -Dtest=MessageBatchTest test` run failed before 
surefire in this local environment because SpotBugs hit 
`java.lang.UnsupportedOperationException: The Security Manager is deprecated 
and will be removed in a future release` on the current JDK. The targeted test 
command above was used to verify the change.
   


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