eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [17/50] incubator-eagle git commit: [EAGLE-614]: NPE in DynamicPolicyLoader
Date Wed, 19 Oct 2016 03:27:32 GMT
[EAGLE-614]: NPE in DynamicPolicyLoader

Author: Zeng, Bryant
Reviewer: ralphsu

This closes #498


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/4dfb528c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/4dfb528c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/4dfb528c

Branch: refs/heads/master
Commit: 4dfb528c4bf2d8935bac78b10a82b6bc15f0be59
Parents: 74c3cbb
Author: mizeng <mizeng@ebaysf.com>
Authored: Thu Oct 13 09:41:15 2016 +0800
Committer: Ralph, Su <suliangfei@gmail.com>
Committed: Thu Oct 13 15:49:03 2016 +0800

----------------------------------------------------------------------
 .../apache/eagle/alert/engine/coordinator/PolicyDefinition.java | 5 ++++-
 .../eagle/alert/coordinator/trigger/DynamicPolicyLoader.java    | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/4dfb528c/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/PolicyDefinition.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/PolicyDefinition.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/PolicyDefinition.java
index 680b21a..6df682a 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/PolicyDefinition.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/coordinator/PolicyDefinition.java
@@ -139,15 +139,18 @@ public class PolicyDefinition implements Serializable {
         if (that == this) {
             return true;
         }
+
         if (!(that instanceof PolicyDefinition)) {
             return false;
         }
+
         PolicyDefinition another = (PolicyDefinition) that;
+
         if (Objects.equals(another.name, this.name)
             && Objects.equals(another.description, this.description)
             && CollectionUtils.isEqualCollection(another.inputStreams, this.inputStreams)
             && CollectionUtils.isEqualCollection(another.outputStreams, this.outputStreams)
-            && another.definition.equals(this.definition)
+            && (another.definition != null && another.definition.equals(this.definition))
             && Objects.equals(this.definition, another.definition)
             && CollectionUtils.isEqualCollection(another.partitionSpec, this.partitionSpec)
             // && another.parallelismHint == this.parallelismHint

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/4dfb528c/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/DynamicPolicyLoader.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/DynamicPolicyLoader.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/DynamicPolicyLoader.java
index a60c959..07ae966 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/DynamicPolicyLoader.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/java/org/apache/eagle/alert/coordinator/trigger/DynamicPolicyLoader.java
@@ -66,7 +66,8 @@ public class DynamicPolicyLoader implements Runnable {
 
             List<String> reallyModifiedPolicies = new ArrayList<>();
             for (String updatedPolicy : potentiallyModifiedPolicies) {
-                if (!currPolicies.get(updatedPolicy).equals(cachedPolicies.get(updatedPolicy)))
{
+                if (currPolicies.get(updatedPolicy) != null
+                        && !currPolicies.get(updatedPolicy).equals(cachedPolicies.get(updatedPolicy)))
{
                     reallyModifiedPolicies.add(updatedPolicy);
                 }
             }


Mime
View raw message