diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java index f7493b08963..d7c7c5a6745 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java @@ -26,7 +26,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Set; import java.util.SortedMap; import java.util.concurrent.BlockingQueue; @@ -713,16 +712,6 @@ class MemStoreFlusher implements FlushRequester { public int compareTo(Delayed o) { return -1; } - - @Override - public int hashCode() { - return System.identityHashCode(this); - } - - @Override - public boolean equals(Object obj) { - return Objects.equals(this, obj); - } } /** diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java index 7438bb7c524..1b0fc9f40a7 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java @@ -18,6 +18,7 @@ package org.apache.hadoop.hbase.procedure; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyListOf; import static org.mockito.Matchers.eq; @@ -250,7 +251,7 @@ public class TestZKProcedure { Subprocedure r = ((Subprocedure) invocation.getMock()); LOG.error("Remote commit failure, not propagating error:" + remoteCause); comms.receiveAbortProcedure(r.getName(), remoteCause); - assertEquals(true, r.isComplete()); + assertTrue(r.isComplete()); // don't complete the error phase until the coordinator has gotten the error // notification (which ensures that we never progress past prepare) try { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java index e443503674d..04dcb926506 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java @@ -2206,8 +2206,7 @@ public class TestHRegion { } catch (Exception e) { ok = true; } - assertEquals("Family " + new String(family, StandardCharsets.UTF_8) + " does exist", - true, ok); + assertTrue("Family " + new String(family, StandardCharsets.UTF_8) + " does exist", ok); } finally { HBaseTestingUtility.closeRegionAndWAL(this.region); this.region = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZooKeeperACL.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZooKeeperACL.java index d668466f6bf..0580cda434f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZooKeeperACL.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZooKeeperACL.java @@ -18,6 +18,7 @@ package org.apache.hadoop.hbase.zookeeper; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.File; @@ -286,7 +287,7 @@ public class TestZooKeeperACL { saslConfFile.getAbsolutePath()); testJaasConfig = ZKUtil.isSecureZooKeeper(new Configuration(TEST_UTIL.getConfiguration())); - assertEquals(false, testJaasConfig); + assertFalse(testJaasConfig); saslConfFile.delete(); } @@ -300,13 +301,13 @@ public class TestZooKeeperACL { Configuration config = new Configuration(HBaseConfiguration.create()); boolean testJaasConfig = ZKUtil.isSecureZooKeeper(config); - assertEquals(false, testJaasConfig); + assertFalse(testJaasConfig); // Now set authentication scheme to Kerberos still it should return false // because no configuration set config.set("hbase.security.authentication", "kerberos"); testJaasConfig = ZKUtil.isSecureZooKeeper(config); - assertEquals(false, testJaasConfig); + assertFalse(testJaasConfig); // Now set programmatic options related to security config.set(HConstants.ZK_CLIENT_KEYTAB_FILE, "/dummy/file"); @@ -314,7 +315,7 @@ public class TestZooKeeperACL { config.set(HConstants.ZK_SERVER_KEYTAB_FILE, "/dummy/file"); config.set(HConstants.ZK_SERVER_KERBEROS_PRINCIPAL, "dummy"); testJaasConfig = ZKUtil.isSecureZooKeeper(config); - assertEquals(true, testJaasConfig); + assertTrue(testJaasConfig); } private static class DummySecurityConfiguration extends javax.security.auth.login.Configuration {