Skip to content
Permalink
Browse files
Fix unsupported warnings
  • Loading branch information
leerho committed Jul 4, 2019
1 parent e4bc4ae commit fc3db1627871697d4b52f47b54492e599c079c92
Showing 2 changed files with 7 additions and 7 deletions.
@@ -83,7 +83,7 @@ public void checkSelfArrayCopy() {
public void checkEquals() {
int len = 7;
WritableMemory wmem1 = WritableMemory.allocate(len);
@SuppressWarnings({"EqualsWithItself", "SelfEquals"})
//@SuppressWarnings({"EqualsWithItself", "SelfEquals"})
//SelfEquals for Plexus, EqualsWithItself for IntelliJ
boolean eq1 = wmem1.equals(wmem1);
assertTrue(eq1);
@@ -126,7 +126,7 @@ public void checkEquals2() {
int len = 23;
WritableMemory wmem1 = WritableMemory.allocate(len);
assertFalse(wmem1.equals(null));
@SuppressWarnings({"EqualsWithItself", "SelfEquals"})
//@SuppressWarnings({"EqualsWithItself", "SelfEquals"})
//SelfEquals for Plexus, EqualsWithItself for IntelliJ
boolean eq1 = wmem1.equals(wmem1);
assertTrue(eq1);
@@ -83,21 +83,21 @@ public void byteArrChecks() {
* OpenHFT/Zero-Allocation-Hashing</a> to test hash compatibility with that implementation.
*/
@Test
@SuppressWarnings("ConstantOverflow")
//@SuppressWarnings("ConstantOverflow")
public void collisionTest() {
WritableMemory wmem = WritableMemory.allocate(128);
wmem.putLong(0, 1);
wmem.putLong(16, 42);
wmem.putLong(32, 2);
long h1 = wmem.xxHash64(0, wmem.getCapacity(), 0);

wmem.putLong(0, 1 + 0xBA79078168D4BAFL);
wmem.putLong(32, 2 + 0x9C90005B80000000L);
wmem.putLong(0, 1L + 0xBA79078168D4BAFL);
wmem.putLong(32, 2L + 0x9C90005B80000000L);
long h2 = wmem.xxHash64(0, wmem.getCapacity(), 0);
assertEquals(h1, h2);

wmem.putLong(0, 1 + (0xBA79078168D4BAFL * 2));
wmem.putLong(32, 2 + (0x9C90005B80000000L * 2));
wmem.putLong(0, 1L + (0xBA79078168D4BAFL * 2));
wmem.putLong(32, 2L + (0x9C90005B80000000L * 2));

long h3 = wmem.xxHash64(0, wmem.getCapacity(), 0);
assertEquals(h2, h3);

0 comments on commit fc3db16

Please sign in to comment.