diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java index 5397496bf834..09d600f26ffe 100644 --- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java +++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java @@ -180,13 +180,7 @@ public int compareTo(MetricsRegionSource source) { if (!(source instanceof MetricsRegionSourceImpl)) { return -1; } - - MetricsRegionSourceImpl impl = (MetricsRegionSourceImpl) source; - if (impl == null) { - return -1; - } - - return Long.compare(hashCode, impl.hashCode); + return Long.compare(hashCode, ((MetricsRegionSourceImpl) source).hashCode); } void snapshot(MetricsRecordBuilder mrb, boolean ignored) {