vibhatha commented on code in PR #38423:
URL: https://github.com/apache/arrow/pull/38423#discussion_r1456691820
##########
java/memory/memory-core/src/test/java/org/apache/arrow/memory/util/hash/TestArrowBufHasher.java:
##########
@@ -116,30 +125,36 @@ public void testHasherNegative() {
public void testHasherLessThanInt() {
try (ArrowBuf buf1 = allocator.buffer(4);
ArrowBuf buf2 = allocator.buffer(4)) {
- buf1.writeBytes("foo1".getBytes(StandardCharsets.UTF_8));
- buf2.writeBytes("bar2".getBytes(StandardCharsets.UTF_8));
+ byte[] ba1 = "foo1".getBytes(StandardCharsets.UTF_8);
+ byte[] ba2 = "bar2".getBytes(StandardCharsets.UTF_8);
+ buf1.writeBytes(ba1);
+ buf2.writeBytes(ba2);
for (int i = 1; i <= 4; i ++) {
- verifyHashCodeNotEqual(buf1, 0, i, buf2, 0, i);
+ verifyHashCodeNotEqual(buf1, ba1, 0, i, buf2, ba2, 0, i);
}
}
}
- private void verifyHashCodeNotEqual(ArrowBuf buf1, int offset1, int length1,
- ArrowBuf buf2, int offset2, int length2)
{
+ private void verifyHashCodeNotEqual(ArrowBuf buf1, byte[] ba1, int offset1,
int length1,
+ ArrowBuf buf2, byte[] ba2, int offset2,
int length2) {
int hashCode1 = hasher.hashCode(buf1, 0, length1);
int hashCode2 = hasher.hashCode(buf2, 0, length2);
assertNotEquals(hashCode1, hashCode2);
+
+ hashCode1 = hasher.hashCode(ba1, 0, length1);
+ hashCode2 = hasher.hashCode(ba2, 0, length2);
+ assertNotEquals(hashCode1, hashCode2);
}
@Parameterized.Parameters(name = "hasher = {0}")
public static Collection<Object[]> getHasher() {
return Arrays.asList(
- new Object[] {SimpleHasher.class.getSimpleName(),
- SimpleHasher.INSTANCE},
- new Object[] {MurmurHasher.class.getSimpleName(),
- new MurmurHasher()
- }
+ new Object[] {SimpleHasher.class.getSimpleName(),
+ SimpleHasher.INSTANCE},
+ new Object[] {MurmurHasher.class.getSimpleName(),
+ new MurmurHasher()
+ }
Review Comment:
why this change?
--
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]