kinow commented on a change in pull request #281:
URL: https://github.com/apache/commons-text/pull/281#discussion_r742269475



##########
File path: src/main/java/org/apache/commons/text/TextStringBuilder.java
##########
@@ -1850,7 +1850,14 @@ public boolean equals(final Object obj) {
      * @return true if the builders contain the same characters in the same 
order
      */
     public boolean equals(final TextStringBuilder other) {
-        return other != null && Arrays.equals(buffer, other.buffer);
+       
+       if(other == null) {
+               return false;
+       }
+       if (this.size != other.size) {
+            return false;
+        }
+        return Arrays.equals(ArrayUtils.subarray(buffer, 0, size), 
ArrayUtils.subarray(other.buffer, 0, size));

Review comment:
       Bad formatting here 👆




-- 
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: issues-unsubscr...@commons.apache.org

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


Reply via email to