This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new ee7f15a  HBASE-26035 Redundant null check in the compareTo function 
(#3433)
ee7f15a is described below

commit ee7f15a675eda7c1e0993f06926e81f8dc515742
Author: Almog Tavor <[email protected]>
AuthorDate: Thu Jul 1 17:56:14 2021 +0300

    HBASE-26035 Redundant null check in the compareTo function (#3433)
    
    Signed-off-by: Duo Zhang <[email protected]>
---
 .../apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

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 5397496..09d600f 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 class MetricsRegionSourceImpl implements 
MetricsRegionSource {
     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) {

Reply via email to