X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodel%2FPDPGroupContainer.java;h=3b3f11957d8d8eb3c18ca9fc6dd36d7c8a46d9d2;hb=0a9a9ba8afe11d0566b092c22f22918cdcb876ab;hp=c05a6744102a24625c9d18fe0ae9b89dfb73afb1;hpb=6f2b3f2dd0e80895acd0f77aa5784e717be33696;p=policy%2Fengine.git 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 c05a67441..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 @@ -142,7 +142,7 @@ public class PDPGroupContainer extends PolicyItemSetChangeNotifier implements Po public void makeDefault(OnapPDPGroup group) { try { - this.papEngine.SetDefaultGroup(group); + this.papEngine.setDefaultGroup(group); } catch (PAPException e) { String message = "Unable to set Default Group on server: " + e; LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + message, e); @@ -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."); } //