chia7712 commented on code in PR #21601:
URL: https://github.com/apache/kafka/pull/21601#discussion_r2894158001


##########
clients/src/main/java/org/apache/kafka/common/utils/Bytes.java:
##########
@@ -34,6 +43,14 @@ public class Bytes implements Comparable<Bytes> {
     // cache the hash code for the string, default to 0
     private int hashCode;
 
+    /**
+     * Creates a Bytes instance wrapping the given byte array.
+     *
+     * <p>The provided array becomes the backing storage for the object.
+     *
+     * @param bytes the byte array to wrap, or null
+     * @return a new Bytes instance, or null if the input is null
+     */
     public static Bytes wrap(byte[] bytes) {
         if (bytes == null)

Review Comment:
   ```java
       @Override
       public String toString() {
           return Bytes.toString(bytes, 0, bytes.length);
       }
   ```
   `bytes.length` could cause NPE



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