[ https://issues.apache.org/jira/browse/TEXT-211?focusedWorklogId=676954&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-676954 ]
ASF GitHub Bot logged work on TEXT-211: --------------------------------------- Author: ASF GitHub Bot Created on: 05/Nov/21 10:03 Start Date: 05/Nov/21 10:03 Worklog Time Spent: 10m Work Description: sebx59 commented on a change in pull request #281: URL: https://github.com/apache/commons-text/pull/281#discussion_r743528784 ########## File path: src/test/java/org/apache/commons/text/TextStringBuilderTest.java ########## @@ -1057,15 +1057,24 @@ public void testHashCode() { final TextStringBuilder sb = new TextStringBuilder(); final int hc1a = sb.hashCode(); final int hc1b = sb.hashCode(); - final int emptyHc = Arrays.hashCode(sb.getBuffer()); - assertEquals(emptyHc, hc1a); Review comment: you're right, I checkded that the 2 hashcodes are not equals -- 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 Issue Time Tracking ------------------- Worklog Id: (was: 676954) Time Spent: 4h (was: 3h 50m) > TextStringBuilder equals method changed behaviour from 1.8 to 1.9 > ----------------------------------------------------------------- > > Key: TEXT-211 > URL: https://issues.apache.org/jira/browse/TEXT-211 > Project: Commons Text > Issue Type: Bug > Affects Versions: 1.9 > Reporter: Nikolaos Georgiou > Priority: Major > Time Spent: 4h > Remaining Estimate: 0h > > We found a regression (or breaking compatibility change) in the > TextStringBuilder equals method when upgrading commons-text from 1.8 to 1.9 > > The 1.8 version ( > [https://github.com/apache/commons-text/blob/commons-text-1.8/src/main/java/org/apache/commons/text/TextStringBuilder.java#L2915] > ) would only compare the parts of the buffer that fall within the range > 0..size. > The 1.9 version ( > [https://github.com/apache/commons-text/blob/rel/commons-text-1.9/src/main/java/org/apache/commons/text/TextStringBuilder.java#L1855] > ) compares the entire buffer arrays. > If a TextStringBuilder has extra capacity in the buffer, comparison fails. > -- This message was sent by Atlassian Jira (v8.3.4#803005)