helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject helix git commit: fix potential NPE in TopStateHandoffReportStage
Date Fri, 02 Nov 2018 17:57:28 GMT
Repository: helix
Updated Branches:
  refs/heads/master 18aa67b6d -> 43555ff0d


fix potential NPE in TopStateHandoffReportStage


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/43555ff0
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/43555ff0
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/43555ff0

Branch: refs/heads/master
Commit: 43555ff0d8cae917accac201e13bafdaf6d32370
Parents: 18aa67b
Author: Harry Zhang <hrzhang@linkedin.com>
Authored: Thu Nov 1 17:48:05 2018 -0700
Committer: Harry Zhang <hrzhang@linkedin.com>
Committed: Fri Nov 2 10:55:42 2018 -0700

----------------------------------------------------------------------
 .../helix/controller/stages/TopStateHandoffReportStage.java   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/43555ff0/helix-core/src/main/java/org/apache/helix/controller/stages/TopStateHandoffReportStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/TopStateHandoffReportStage.java
b/helix-core/src/main/java/org/apache/helix/controller/stages/TopStateHandoffReportStage.java
index 699f2a8..5bfd5e6 100644
--- a/helix-core/src/main/java/org/apache/helix/controller/stages/TopStateHandoffReportStage.java
+++ b/helix-core/src/main/java/org/apache/helix/controller/stages/TopStateHandoffReportStage.java
@@ -490,10 +490,9 @@ public class TopStateHandoffReportStage extends AbstractBaseStage {
       Partition partition) {
     if (missingTopStateMap.containsKey(resourceName)) {
       missingTopStateMap.get(resourceName).remove(partition.getPartitionName());
-    }
-
-    if (missingTopStateMap.get(resourceName).size() == 0) {
-      missingTopStateMap.remove(resourceName);
+      if (missingTopStateMap.get(resourceName).isEmpty()) {
+        missingTopStateMap.remove(resourceName);
+      }
     }
   }
 


Mime
View raw message