eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinh...@apache.org
Subject incubator-eagle git commit: [EAGLE-682] fix /policies/{policyId}/publishments bug
Date Tue, 25 Oct 2016 09:24:49 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master 15f39705d -> 7a2255670


[EAGLE-682] fix /policies/{policyId}/publishments bug

Author: wujinhu <wujinhu920@126.com>

Closes #560 from wujinhu/EAGLE-682.


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

Branch: refs/heads/master
Commit: 7a2255670c0404fa734859792ed3f2878174ef72
Parents: 15f3970
Author: wujinhu <wujinhu920@126.com>
Authored: Tue Oct 25 17:24:43 2016 +0800
Committer: wujinhu <wujinhu920@126.com>
Committed: Tue Oct 25 17:24:43 2016 +0800

----------------------------------------------------------------------
 .../eagle/service/metadata/resource/MetadataResource.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/7a225567/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/main/java/org/apache/eagle/service/metadata/resource/MetadataResource.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/main/java/org/apache/eagle/service/metadata/resource/MetadataResource.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/main/java/org/apache/eagle/service/metadata/resource/MetadataResource.java
index 3368517..6b88a4e 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/main/java/org/apache/eagle/service/metadata/resource/MetadataResource.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/main/java/org/apache/eagle/service/metadata/resource/MetadataResource.java
@@ -34,10 +34,7 @@ import com.google.inject.Inject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 import javax.ws.rs.*;
 
@@ -258,6 +255,9 @@ public class MetadataResource {
             for (String publishmentId : publishmentIds) {
                 if (publishmentMap.containsKey(publishmentId)) {
                     Publishment publishment = publishmentMap.get(publishmentId);
+                    if (publishment.getPolicyIds() == null) {
+                        publishment.setPolicyIds(new ArrayList<>());
+                    }
                     if (publishment.getPolicyIds().contains(policyId)) {
                         LOG.warn("Policy {} was already bound with publisher {}",policyId,
publishmentId);
                     } else {


Mime
View raw message