diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java index cf2ef6fe600..557a61a49c7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java @@ -62,7 +62,7 @@ public class MemStoreSize { @Override public boolean equals(Object obj) { - if (obj == null || !(obj instanceof MemStoreSize)) { + if (obj == null || getClass() != obj.getClass()) { return false; } MemStoreSize other = (MemStoreSize) obj; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSizing.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSizing.java index fade6222513..b13201d4a23 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSizing.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSizing.java @@ -82,7 +82,7 @@ public class MemStoreSizing extends MemStoreSize { @Override public boolean equals(Object obj) { - if (obj == null || !(obj instanceof MemStoreSizing)) { + if (obj == null || (getClass() != obj.getClass())) { return false; } MemStoreSizing other = (MemStoreSizing) obj;