funky-eyes commented on code in PR #7344:
URL: https://github.com/apache/incubator-seata/pull/7344#discussion_r2095339483


##########
server/src/main/java/org/apache/seata/server/session/BranchSession.java:
##########
@@ -405,31 +383,92 @@ public byte[] encode() {
 
         byteBuffer.put(branchTypeByte);
 
-        byteBuffer.put((byte)status.getCode());
-        byteBuffer.put((byte)lockStatus.getCode());
+        byteBuffer.put((byte) status.getCode());
+        byteBuffer.put((byte) lockStatus.getCode());
         BufferUtils.flip(byteBuffer);
         byte[] result = new byte[byteBuffer.limit()];
         byteBuffer.get(result);
         return result;
     }
 
-    private int calBranchSessionSize(byte[] resourceIdBytes, byte[] 
lockKeyBytes, byte[] clientIdBytes,
-                                     byte[] applicationDataBytes, byte[] 
xidBytes) {
-        final int size = 8 // trascationId
-            + 8 // branchId
-            + 4 // resourceIdBytes.length
-            + 4 // lockKeyBytes.length
-            + 2 // clientIdBytes.length
-            + 4 // applicationDataBytes.length
-            + 4 // xidBytes.size
-            + 1 // statusCode
-            + (resourceIdBytes == null ? 0 : resourceIdBytes.length)
-            + (lockKeyBytes == null ? 0 : lockKeyBytes.length)
-            + (clientIdBytes == null ? 0 : clientIdBytes.length)
-            + (applicationDataBytes == null ? 0 : applicationDataBytes.length)
-            + (xidBytes == null ? 0 : xidBytes.length)
-            + 1; //branchType
-        return size;
+    public void checkSize() throws TransactionException {

Review Comment:
   done



-- 
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: notifications-unsubscr...@seata.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to