From 2db38abffcd89bf1fa0cad953254daea7e4e415b Mon Sep 17 00:00:00 2001 From: Shweta Yakkali Date: Mon, 18 Mar 2019 15:10:26 +0100 Subject: [PATCH] HDFS-14328. [Clean-up] Remove NULL check before instanceof in TestGSet (Contributed by Shweta Yakkali via Daniel Templeton) Change-Id: I5b9f0e66664714d7c5bbfa30492a09f770626711 --- .../src/test/java/org/apache/hadoop/util/TestGSet.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGSet.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGSet.java index 2d39f3daa5..14dde6a0c7 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGSet.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGSet.java @@ -23,7 +23,6 @@ import java.util.Random; import org.apache.hadoop.HadoopIllegalArgumentException; -import org.apache.hadoop.util.Time; import org.junit.Assert; import org.junit.Test; @@ -471,7 +470,7 @@ private static class IntElement implements LightWeightGSet.LinkedElement, @Override public boolean equals(Object obj) { - return obj != null && obj instanceof IntElement + return obj instanceof IntElement && value == ((IntElement)obj).value; }