From: Pamela Dragosh Date: Wed, 27 Sep 2017 03:11:28 +0000 (+0000) Subject: Merge "Policy Architecture documentation" X-Git-Tag: v1.1.0~49 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=fd823c430e9e54d21b6598971da68a1268d9b14c;hp=1e2f68b8a40b08f7f4e180071a8bca91563fe16f;p=policy%2Fengine.git Merge "Policy Architecture documentation" --- diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyNotificationController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyNotificationController.java index 21f3793f1..f987f906d 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyNotificationController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyNotificationController.java @@ -64,13 +64,13 @@ public class PolicyNotificationController extends RestrictedBaseController { String responseValue = ""; try { String userId = UserUtils.getUserSession(request).getOrgUserId(); - System.out.println(userId); + logger.info("userid info: " + userId); ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); JsonNode root = mapper.readTree(request.getReader()); String name = root.get("watchData").get("name").toString(); JsonNode pathList = root.get("watchData").get("path"); - String finalName = ""; + String finalName; if(pathList.isArray()){ ArrayNode arrayNode = (ArrayNode) pathList; for (int i = 0; i < arrayNode.size(); i++) { diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/model/PDPGroupContainer.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/model/PDPGroupContainer.java index 04ec3e868..3b3f11957 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/model/PDPGroupContainer.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/model/PDPGroupContainer.java @@ -365,7 +365,7 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier implements Po @Override public Object firstItemId() { synchronized (this.groups) { - if (this.groups.size() > 0) { + if (!this.groups.isEmpty()) { return this.groups.get(0); } } @@ -375,7 +375,7 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier implements Po @Override public Object lastItemId() { synchronized (this.groups) { - if (this.groups.size() > 0) { + if (!this.groups.isEmpty()) { return this.groups.get(this.groups.size() - 1); } } @@ -385,8 +385,8 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier implements Po @Override public boolean isFirstId(Object itemId) { synchronized (this.groups) { - if (this.groups.size() > 0) { - return (this.groups.get(0).equals(itemId)); + if (!this.groups.isEmpty()) { + return this.groups.get(0).equals(itemId); } } return false; @@ -395,8 +395,8 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier implements Po @Override public boolean isLastId(Object itemId) { synchronized (this.groups) { - if (this.groups.size() > 0) { - return (this.groups.get(this.groups.size() - 1).equals(itemId)); + if (!this.groups.isEmpty()) { + return this.groups.get(this.groups.size() - 1).equals(itemId); } } return false; @@ -444,7 +444,7 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier implements Po // // You cannot remove the default group // - if (((OnapPDPGroup) itemId).getId().equals("Default")) { + if ("Default".equals(((OnapPDPGroup) itemId).getId())) { throw new UnsupportedOperationException("You can't remove the Default Group."); } //