LuciferYang opened a new pull request, #13442:
URL: https://github.com/apache/gravitino/pull/13442

   ### What changes were proposed in this pull request?
   
   `ExtendedGroupPO.equals` now calls `super.equals` (the `GroupPO` identity 
fields) in addition to comparing `roleIds`/`roleNames`, matching what 
`hashCode` already covers and aligning with the sibling `ExtendedUserPO`.
   
   ### Why are the changes needed?
   
   `equals` compared only the role fields while `hashCode` folded in 
`super.hashCode()`, so two extended rows for different groups with identical 
roles were equal but hashed differently, breaking the `Object.hashCode` 
contract for any hash-based collection.
   
   Fix: #13441
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Added `TestExtendedGroupPO.testEqualsIncludesGroupFields` (two rows for 
different groups with the same roles are not equal) and 
`testEqualsAndHashCodeConsistent`. They fail against the pre-fix code.
   


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