KalleOlaviNiemitalo commented on PR #3175:
URL: https://github.com/apache/avro/pull/3175#issuecomment-2372726325

   I feel there should be a test to verify that the result of Utf8.hashCode 
does not depend on whether the array has unused bytes in it.  
TestUtf8.hashCodeReused seems to largely cover that by hardcoding specific hash 
codes but it does not compute hash codes for equal sequences of bytes in two 
ways.  I'm thinking about test code like
   
   ```java
   Utf8 u1 = new Utf8("abcdefghi"); // length=9, bytes.length=9
   u1.setByteLength(8); // length=8, bytes.length=9
   Utf8 u2 = new Utf8("abcdefgh"); // length=8, bytes.length=8
   assertEquals(u1.hashCode(), u2.getHashCode());
   ```
   
   or with a hardcoded hash code in the test.


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