tanyaofei commented on code in PR #7683:
URL: https://github.com/apache/incubator-seata/pull/7683#discussion_r2416185284


##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/xa/XABranchXid.java:
##########
@@ -123,4 +124,18 @@ private void decode() {
     public String toString() {
         return xid + BRANCH_ID_PREFIX + branchId;
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        XABranchXid that = (XABranchXid) o;
+        return branchId == that.branchId && Objects.equals(xid, that.xid);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(xid, branchId);
+    }

Review Comment:
   I believe we should include the following check
   ```java
   if ( this == o ) {
       return true;
   }
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to