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

   ### Motivation
   
   `brokerId` participates in `SubscriptionGroupConfig.hashCode` but was 
missing from `equals`, so two configs for the same group that differ only in 
`brokerId` compared equal while hashing differently — breaking the `Object` 
contract for any `HashSet`/`HashMap` keyed on `SubscriptionGroupConfig` 
(lookups miss, set dedup misbehaves).
   
   ### Modifications
   
   Append `brokerId` to `equals` to match `hashCode`.
   
   ### Verification
   
   Fail-before (new test, run against the unpatched code):
   
   ```
   Tests run: 1, Failures: 1, Errors: 0 -- 
SubscriptionGroupConfigTest#testBrokerIdParticipatesInEqualsAndHashCode
   java.lang.AssertionError: Values should be different. Actual: 
SubscriptionGroupConfig{groupName=groupA, ..., brokerId=1, ...}
   ```
   
   Pass-after:
   
   ```
   Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 -- 
SubscriptionGroupConfigTest
   ```
   


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