Fixed the Sonar technical debt. 73/29573/4
authorAnkitkumar Patel <ankit@research.att.com>
Tue, 30 Jan 2018 03:42:19 +0000 (22:42 -0500)
committerAnkitkumar Patel <ankit@research.att.com>
Wed, 31 Jan 2018 20:57:42 +0000 (15:57 -0500)
Fixed the sonar technical dept primarily for the POLICY-REST module, and
accordingly updated the other policy-engine modules for successful built.

Issue-ID: POLICY-476
Change-Id: I0e9bd7209a7f9af247fa409a1682683082f92698
Signed-off-by: Ankitkumar Patel <ankit@research.att.com>
91 files changed:
.gitignore
ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateNewMicroServiceModel.java
ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/elk/client/PolicyElasticData.java
ONAP-REST/src/main/java/org/onap/policy/rest/XACMLRest.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/AddressGroupJson.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/AddressJson.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/AutoPushTabAdapter.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ClosedLoopPerformanceMetrics.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ClosedLoopPolicy.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/GridData.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PolicyExportAdapter.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PolicyRestAdapter.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/PrefixIPList.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/RainyDayParams.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ServiceGroupJson.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/ServiceListJson.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/Term.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/TermCollector.java
ONAP-REST/src/main/java/org/onap/policy/rest/adapter/VendorSpecificData.java
ONAP-REST/src/main/java/org/onap/policy/rest/dao/PolicyDBException.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ActionBodyEntity.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ActionList.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ActionPolicyDict.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/AddressGroup.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Attribute.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/AttributeAssignment.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/BRMSParamTemplate.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Category.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoopD2Services.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoopSite.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ClosedLoops.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConfigurationDataEntity.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConstraintType.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ConstraintValue.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DCAEUsers.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DCAEuuid.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DatabaseLockEntity.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Datatype.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DecisionSettings.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/DescriptiveScope.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/FWTag.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/FWTagPicker.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/FirewallDictionaryList.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/FunctionArgument.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/FunctionDefinition.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/GroupPolicyScopeList.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/GroupServiceList.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/MicroServiceAttribute.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/MicroServiceConfigName.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/MicroServiceLocation.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/MicroServiceModels.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ObadviceExpression.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/OnapName.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PEPOptions.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PIPConfigParam.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PIPConfiguration.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PIPResolver.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PIPResolverParam.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PIPType.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyAlgorithms.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyEditorScopes.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyEntity.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyRoles.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyScopeClosedLoop.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyScopeResource.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyScopeService.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyScopeType.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyScore.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PolicyVersion.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PortList.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/PrefixList.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ProtocolList.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/RainyDayTreatments.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/RemoteCatalogValues.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/RiskType.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/RuleAlgorithms.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/SafePolicyWarning.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/SecurityZone.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/ServiceList.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/TermList.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/VMType.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/VNFType.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/VSCLAction.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/VarbindDictionary.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/WatchPolicyNotificationTable.java
ONAP-REST/src/main/java/org/onap/policy/rest/jpa/Zone.java
ONAP-REST/src/main/java/org/onap/policy/rest/util/MSAttributeObject.java
ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java
ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java
ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidationRequestWrapper.java
POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java

index 6329724..6ab843b 100644 (file)
@@ -4,6 +4,7 @@
 .classpath
 .jupiter
 .pydevproject
+.idea
 target
 .metadata/
 ASTRAGateway/policyEngineLog.log
@@ -30,6 +31,8 @@ XACML-PDP-REST/catalina.base_IS_UNDEFINED/logs/Policy/XACML-PDP-REST/metrics.log
 XACML-REST/IntegrityMonitor.log
 /bin/
 *.checkstyle
+*.iml
+*.log
 BRMSGateway/logs/
 BRMSGateway/sql/
 BRMSGateway/src/test/resources/META-INF/generatedCreate.ddl
index aad70e5..af78956 100644 (file)
@@ -70,7 +70,7 @@ public class CreateNewMicroServiceModel {
                this.newModel.setUserCreatedBy(userInfo);
                String cleanUpFile = null;
        
-           HashMap<String, MSAttributeObject> tempMap = new HashMap<>();
+           Map<String, MSAttributeObject> tempMap = new HashMap<>();
            //Need to delete the file
            if (importFile.contains(".zip")){
                extractFolder(randomID + ".zip");
@@ -143,16 +143,14 @@ public class CreateNewMicroServiceModel {
                            int currentByte;
 
                            byte data[] = new byte[BUFFER];
-       
-                           FileOutputStream fos = new FileOutputStream(destFile);
-                           BufferedOutputStream dest = new BufferedOutputStream(fos,
-                           BUFFER);
-       
-                           while ((currentByte = is.read(data, 0, BUFFER)) != -1) {
-                               dest.write(data, 0, currentByte);
-                           }
-                           dest.flush();
-                           dest.close();
+                                       try(FileOutputStream fos = new FileOutputStream(destFile);
+                                               BufferedOutputStream dest = new BufferedOutputStream(fos, BUFFER)) {
+
+                                               while ((currentByte = is.read(data, 0, BUFFER)) != -1) {
+                                                       dest.write(data, 0, currentByte);
+                                               }
+                                               dest.flush();
+                                       }
                            is.close();
                        }
        
@@ -177,7 +175,7 @@ public class CreateNewMicroServiceModel {
                
                Map<String, String> successMap = new HashMap<>();
                MSAttributeObject mainClass  = null;
-               ArrayList<String> dependency = null;
+               List<String> dependency = null;
                String subAttribute = null;
                
                if (!classMap.containsKey(this.newModel.getModelName())){
index cde0538..e56e82c 100644 (file)
@@ -41,10 +41,10 @@ public class PolicyElasticData {
        private String jsonBody;
        private Object jsonBodyData;
        
-       private LinkedHashMap<?, ?> serviceTypePolicyName;
-       private LinkedHashMap<?, ?> verticaMetrics;
-    private LinkedHashMap<?, ?> description;
-    private LinkedHashMap<?, ?> attributeFields;
+       private Map<?, ?> serviceTypePolicyName;
+       private Map<?, ?> verticaMetrics;
+    private Map<?, ?> description;
+    private Map<?, ?> attributeFields;
 
        //Safe Policy
        private String policyScope;
@@ -55,8 +55,8 @@ public class PolicyElasticData {
        private String ttlDate;
        private  Map<String,String> matching; 
 
-       private ArrayList<Object> triggerSignatures;
-       private ArrayList<Object> symptomSignatures;
+       private List<Object> triggerSignatures;
+       private List<Object> symptomSignatures;
        private String logicalConnector;
        private String policyStatus;
        public String gocServerScope;
@@ -86,7 +86,7 @@ public class PolicyElasticData {
 
        //FireWall
        private String fwPolicyType;
-       private ArrayList<Object> fwattributes;
+       private List<Object> fwattributes;
        private String parentForChild;
        private String securityZone;
 
@@ -262,7 +262,7 @@ public class PolicyElasticData {
        public void setJsonBody(String jsonBody) {
                this.jsonBody = jsonBody;
        }
-       public LinkedHashMap<?, ?> getServiceTypePolicyName() {
+       public Map<?, ?> getServiceTypePolicyName() {
                return serviceTypePolicyName;
        }
 
@@ -270,7 +270,7 @@ public class PolicyElasticData {
                this.serviceTypePolicyName = serviceTypePolicyName;
        }
 
-       public LinkedHashMap<?, ?> getVerticaMetrics() {
+       public Map<?, ?> getVerticaMetrics() {
                return verticaMetrics;
        }
 
@@ -278,15 +278,15 @@ public class PolicyElasticData {
                this.verticaMetrics = verticaMetrics;
        }
 
-       public LinkedHashMap<?, ?> getDescription() {
+       public Map<?, ?> getDescription() {
                return description;
        }
 
-       public void setDescription(LinkedHashMap<?, ?> description) {
+       public void setDescription(Map<?, ?> description) {
                this.description = description;
        }
 
-       public LinkedHashMap<?, ?> getAttributeFields() {
+       public Map<?, ?> getAttributeFields() {
                return attributeFields;
        }
 
@@ -335,13 +335,13 @@ public class PolicyElasticData {
        public void setMatching(Map<String, String> matching) {
                this.matching = matching;
        }
-       public ArrayList<Object> getTriggerSignatures() {
+       public List<Object> getTriggerSignatures() {
                return triggerSignatures;
        }
        public void setTriggerSignatures(ArrayList<Object> triggerSignatures) {
                this.triggerSignatures = triggerSignatures;
        }
-       public ArrayList<Object> getSymptomSignatures() {
+       public List<Object> getSymptomSignatures() {
                return symptomSignatures;
        }
        public void setSymptomSignatures(ArrayList<Object> symptomSignatures) {
@@ -422,16 +422,16 @@ public class PolicyElasticData {
        public List<String> getBrmsDependency() {
                return brmsDependency;
        }
-       public void setBrmsDependency(ArrayList<String> brmsDependency) {
+       public void setBrmsDependency(List<String> brmsDependency) {
                this.brmsDependency = brmsDependency;
        }
-       public LinkedHashMap<?, ?> getRuleData() {
+       public Map<?, ?> getRuleData() {
                return ruleData;
        }
        public void setRuleData(LinkedHashMap<?, ?> ruleData) {
                this.ruleData = ruleData;
        }
-       public LinkedHashMap<?, ?> getRuleListData() {
+       public Map<?, ?> getRuleListData() {
                return ruleListData;
        }
        public void setRuleListData(LinkedHashMap<?, ?> ruleListData) {
@@ -473,7 +473,7 @@ public class PolicyElasticData {
        public void setFwPolicyType(String fwPolicyType) {
                this.fwPolicyType = fwPolicyType;
        }
-       public ArrayList<Object> getFwattributes() {
+       public List<Object> getFwattributes() {
                return fwattributes;
        }
        public void setFwattributes(ArrayList<Object> fwattributes) {
index 6bef28d..0912515 100644 (file)
@@ -46,7 +46,10 @@ import com.att.research.xacml.util.XACMLProperties;
 public class XACMLRest {
        private static final Log logger = LogFactory.getLog(XACMLRest.class);
        private static Properties restProperties = new Properties();
-       
+
+       private XACMLRest(){
+           // Empty constructor
+    }
        /**
         * This must be called during servlet initialization. It sets up the xacml.?.properties
         * file as a system property. If the System property is already set, then it does not
@@ -96,9 +99,8 @@ public class XACMLRest {
                Enumeration<String> params = config.getInitParameterNames();
                while (params.hasMoreElements()) {
                        String param = params.nextElement();
-                       if (! param.equals("XACML_PROPERTIES_NAME")) {
+                       if (! "XACML_PROPERTIES_NAME".equals(param)) {
                                String value = config.getInitParameter(param);
-                               //logger.info(param + "=" + config.getInitParameter(param));
                                PolicyLogger.info(param + "=" + config.getInitParameter(param));
                                restProperties.setProperty(param, value);
                        }
@@ -161,8 +163,7 @@ public class XACMLRest {
        public static void dumpRequest(HttpServletRequest request) {
                if (logger.isDebugEnabled()) {
                        // special-case for receiving heartbeat - don't need to repeatedly output all of the information in multiple lines
-                       if (request.getMethod().equals("GET") && "hb".equals(request.getParameter("type"))  ) {
-                               //logger.debug("GET type=hb : heartbeat received");
+                       if ("GET".equals(request.getMethod()) && "hb".equals(request.getParameter("type"))  ) {
                                PolicyLogger.debug("GET type=hb : heartbeat received");
                                return;                         
                        }
@@ -185,7 +186,7 @@ public class XACMLRest {
                                logger.debug(element + ":" + request.getAttribute(element));
                        }
                        logger.debug("ContextPath: " + request.getContextPath());
-                       if (request.getMethod().equals("PUT") || request.getMethod().equals("POST")) {
+                       if ("PUT".equals(request.getMethod()) || "POST".equals(request.getMethod())) {
                                // POST and PUT are allowed to have parameters in the content, but in our usage the parameters are always in the Query string.
                                // More importantly, there are cases where the POST and PUT content is NOT parameters (e.g. it might contain a Policy file).
                                // Unfortunately the request.getParameterMap method reads the content to see if there are any parameters,
index da4671b..6f7b88f 100644 (file)
@@ -39,6 +39,7 @@ public class AddressGroupJson {
                this.name = value;
        }
        
+       @Override
        public boolean equals(Object obj){
                if(obj == null){
                        return false;
@@ -52,8 +53,8 @@ public class AddressGroupJson {
                }       
                return false;
        }
-       
-        public int hashCode() {
+       @Override
+       public int hashCode() {
            return Integer.valueOf(name.charAt(0)+(name.charAt(1)));
         }
        
@@ -70,7 +71,7 @@ public class AddressGroupJson {
     {
        if(members==null)
        {
-               members= new ArrayList<AddressMembersJson>();
+               members= new ArrayList<>();
        }
         return this.members;
     }
index 5559943..0087586 100644 (file)
@@ -41,12 +41,5 @@ public class AddressJson {
        public void setType(String type) {
                this.type = type;
        }
-       
-       /*public String getValue() {
-               return value;
-       }
 
-       public void setValue(String value) {
-               this.value = value;
-       }*/
 }
index 4e5336a..93d332c 100644 (file)
 package org.onap.policy.rest.adapter;
 
 
-import java.util.ArrayList;
+import java.util.List;
 
 public class AutoPushTabAdapter {
 
-       private ArrayList<Object> pdpDatas;
-       private ArrayList<Object> policyDatas;
-       public ArrayList<Object> getPdpDatas() {
+       private List<Object> pdpDatas;
+       private List<Object> policyDatas;
+       public List<Object> getPdpDatas() {
                return pdpDatas;
        }
-       public void setPdpDatas(ArrayList<Object> pdpDatas) {
+       public void setPdpDatas(List<Object> pdpDatas) {
                this.pdpDatas = pdpDatas;
        }
-       public ArrayList<Object> getPolicyDatas() {
+       public List<Object> getPolicyDatas() {
                return policyDatas;
        }
-       public void setPolicyDatas(ArrayList<Object> policyDatas) {
+       public void setPolicyDatas(List<Object> policyDatas) {
                this.policyDatas = policyDatas;
        }
 }
index 32839e9..9754646 100644 (file)
@@ -33,4 +33,8 @@ public class ClosedLoopPerformanceMetrics {
        
        public static final String CLPM_UIFIELD_GEOLINK = "Geo Link";   
        public static final String CLPM_UIJSON_GEOLINK = "geoLink";
+
+       private ClosedLoopPerformanceMetrics() {
+           // Empty constructor
+    }
 }
index a230db8..ea1cfb5 100644 (file)
@@ -58,4 +58,7 @@ public class ClosedLoopPolicy {
        public static final String CLFAULT_UIFIELD_POLICY_STATUS_INACTIVE = "InActive";
        public static final String CLFAULT_UIJSON_POLICY_STATUS_INACTIVE = "INACTIVE";
 
+       private ClosedLoopPolicy(){
+               // Empty constructor
+       }
 }
index 77bbf03..4e5b4a3 100644 (file)
 package org.onap.policy.rest.adapter;
 
 
-import java.util.ArrayList;
+import java.util.List;
 
 public class GridData {
-       private ArrayList<Object> attributes;
-       private ArrayList<Object> transportProtocols;
-       private ArrayList<Object> appProtocols;
+       private List<Object> attributes;
+       private List<Object> transportProtocols;
+       private List<Object> appProtocols;
 
-       public ArrayList<Object> getAttributes() {
+       public List<Object> getAttributes() {
                return attributes;
        }
 
-       public void setAttributes(ArrayList<Object> attributes) {
+       public void setAttributes(List<Object> attributes) {
                this.attributes = attributes;
        }
 
-       public ArrayList<Object> getAppProtocols() {
+       public List<Object> getAppProtocols() {
                return appProtocols;
        }
 
-       public void setAppProtocols(ArrayList<Object> appProtocols) {
+       public void setAppProtocols(List<Object> appProtocols) {
                this.appProtocols = appProtocols;
        }
 
-       public ArrayList<Object> getTransportProtocols() {
+       public List<Object> getTransportProtocols() {
                return transportProtocols;
        }
 
-       public void setTransportProtocols(ArrayList<Object> transportProtocols) {
+       public void setTransportProtocols(List<Object> transportProtocols) {
                this.transportProtocols = transportProtocols;
        }
 }
index 21efb9b..2b42207 100644 (file)
 package org.onap.policy.rest.adapter;
 
 
-import java.util.ArrayList;
+import java.util.List;
 
 public class PolicyExportAdapter {
        
-       private ArrayList<Object> policyDatas;
+       private List<Object> policyDatas;
        
-       public ArrayList<Object> getPolicyDatas() {
+       public List<Object> getPolicyDatas() {
                return policyDatas;
        }
-       public void setPolicyDatas(ArrayList<Object> policyDatas) {
+       public void setPolicyDatas(List<Object> policyDatas) {
                this.policyDatas = policyDatas;
        }
 }
index 1eb4da8..b4056a3 100644 (file)
@@ -83,15 +83,15 @@ public class PolicyRestAdapter {
        private Object jsonBodyData;
        private String dirPath;
        private String configBodyPath;
-       private ArrayList<Object> attributes;
-       private ArrayList<Object> settings;
-       private ArrayList<Object> ruleAlgorithmschoices;
+       private List<Object> attributes;
+       private List<Object> settings;
+       private List<Object> ruleAlgorithmschoices;
        
-       private LinkedHashMap<?, ?> serviceTypePolicyName;
+       private Map<?, ?> serviceTypePolicyName;
    
-       private LinkedHashMap<?, ?> verticaMetrics;
-    private LinkedHashMap<?, ?> description;
-    private LinkedHashMap<?, ?> attributeFields;
+       private Map<?, ?> verticaMetrics;
+    private Map<?, ?> description;
+    private Map<?, ?> attributeFields;
     
     //ClosedLoop
        private String clearTimeOut;
@@ -101,7 +101,7 @@ public class PolicyRestAdapter {
        
     //FireWall
     private String fwPolicyType;
-       private ArrayList<Object> fwattributes;
+       private List<Object> fwattributes;
        private String parentForChild;
        private String securityZone;
        
@@ -159,24 +159,24 @@ public class PolicyRestAdapter {
        private String ttlDate;
        private Map<String,String> matching; 
        
-       private ArrayList<Object> triggerSignatures;
-    private ArrayList<Object> symptomSignatures;
+       private List<Object> triggerSignatures;
+    private List<Object> symptomSignatures;
     private String logicalConnector;
     private String policyStatus;
     private String gocServerScope;
     private String supressionType;
     
     
-       public ArrayList<Object> getTriggerSignatures() {
+       public List<Object> getTriggerSignatures() {
                return triggerSignatures;
        }
-       public void setTriggerSignatures(ArrayList<Object> triggerSignatures) {
+       public void setTriggerSignatures(List<Object> triggerSignatures) {
                this.triggerSignatures = triggerSignatures;
        }
-       public ArrayList<Object> getSymptomSignatures() {
+       public List<Object> getSymptomSignatures() {
                return symptomSignatures;
        }
-       public void setSymptomSignatures(ArrayList<Object> symptomSignatures) {
+       public void setSymptomSignatures(List<Object> symptomSignatures) {
                this.symptomSignatures = symptomSignatures;
        }
        public String getLogicalConnector() {
@@ -647,43 +647,43 @@ public class PolicyRestAdapter {
        public void setConfigBodyPath(String configBodyPath) {
                this.configBodyPath = configBodyPath;
        }
-       public ArrayList<Object> getAttributes() {
+       public List<Object> getAttributes() {
                return attributes;
        }
-       public void setAttributes(ArrayList<Object> attributes) {
+       public void setAttributes(List<Object> attributes) {
                this.attributes = attributes;
        }
-       public ArrayList<Object> getSettings() {
+       public List<Object> getSettings() {
                return settings;
        }
-       public void setSettings(ArrayList<Object> settings) {
+       public void setSettings(List<Object> settings) {
                this.settings = settings;
        }
-       public ArrayList<Object> getRuleAlgorithmschoices() {
+       public List<Object> getRuleAlgorithmschoices() {
                return ruleAlgorithmschoices;
        }
-       public void setRuleAlgorithmschoices(ArrayList<Object> ruleAlgorithmschoices) {
+       public void setRuleAlgorithmschoices(List<Object> ruleAlgorithmschoices) {
                this.ruleAlgorithmschoices = ruleAlgorithmschoices;
        }
-       public LinkedHashMap<?, ?> getServiceTypePolicyName() {
+       public Map<?, ?> getServiceTypePolicyName() {
                return serviceTypePolicyName;
        }
-       public void setServiceTypePolicyName(LinkedHashMap<?, ?> serviceTypePolicyName) {
+       public void setServiceTypePolicyName(Map<?, ?> serviceTypePolicyName) {
                this.serviceTypePolicyName = serviceTypePolicyName;
        }
-       public LinkedHashMap<?, ?> getVerticaMetrics() {
+       public Map<?, ?> getVerticaMetrics() {
                return verticaMetrics;
        }
-       public void setVerticaMetrics(LinkedHashMap<?, ?> verticaMetrics) {
+       public void setVerticaMetrics(Map<?, ?> verticaMetrics) {
                this.verticaMetrics = verticaMetrics;
        }
-       public LinkedHashMap<?, ?> getDescription() {
+       public Map<?, ?> getDescription() {
                return description;
        }
        public void setDescription(LinkedHashMap<?, ?> description) {
                this.description = description;
        }
-       public LinkedHashMap<?, ?> getAttributeFields() {
+       public Map<?, ?> getAttributeFields() {
                return attributeFields;
        }
        public void setAttributeFields(LinkedHashMap<?, ?> attributeFields) {
@@ -719,10 +719,10 @@ public class PolicyRestAdapter {
        public void setFwPolicyType(String fwPolicyType) {
                this.fwPolicyType = fwPolicyType;
        }
-       public ArrayList<Object> getFwattributes() {
+       public List<Object> getFwattributes() {
                return fwattributes;
        }
-       public void setFwattributes(ArrayList<Object> fwattributes) {
+       public void setFwattributes(List<Object> fwattributes) {
                this.fwattributes = fwattributes;
        }
        public String getParentForChild() {
index c9b5b0c..23ae537 100644 (file)
@@ -51,7 +51,7 @@ public class PrefixIPList {
     {
        if(members==null)
        {
-               members= new ArrayList<AddressMembers>();
+               members= new ArrayList<>();
        }
         return this.members;
     }
@@ -60,13 +60,5 @@ public class PrefixIPList {
        {
                this.members = members;
        }
-    /*public String getValue() {
-        return value;
-    }
 
-   
-    public void setValue(String value) {
-        this.value = value;
-    }*/
-    
 }
index 809a881..ce31b88 100644 (file)
@@ -20,7 +20,6 @@
 
 package org.onap.policy.rest.adapter;
 
-import java.util.ArrayList;
 import java.util.List;
 
 public class RainyDayParams {
@@ -28,7 +27,7 @@ public class RainyDayParams {
        private String vnfType;
        private String bbid;
        private String workstep;
-       private ArrayList<Object> treatmentTableChoices;
+       private List<Object> treatmentTableChoices;
        private List<String> errorcode;
        private List<String> treatment;
 
@@ -83,13 +82,13 @@ public class RainyDayParams {
        /**
         * @return the treatmentTableChoices
         */
-       public ArrayList<Object> getTreatmentTableChoices() {
+       public List<Object> getTreatmentTableChoices() {
                return treatmentTableChoices;
        }
        /**
         * @param treatmentTableChoices the treatmentTableChoices to set
         */
-       public void setTreatmentTableChoices(ArrayList<Object> treatmentTableChoices) {
+       public void setTreatmentTableChoices(List<Object> treatmentTableChoices) {
                this.treatmentTableChoices = treatmentTableChoices;
        }
        /**
index 0d06552..363f73f 100644 (file)
@@ -38,7 +38,8 @@ public class ServiceGroupJson {
        public void setName(String value) {
                this.name = value;
        }
-       
+
+       @Override
        public boolean equals(Object obj){
                if(obj == null){
                        return false;
@@ -52,8 +53,9 @@ public class ServiceGroupJson {
                }
                return false;
        }
-       
-        public int hashCode() {
+
+       @Override
+       public int hashCode() {
            return Integer.valueOf(name.charAt(0)+(name.charAt(1)));
         }
        
@@ -70,7 +72,7 @@ public class ServiceGroupJson {
     {
        if(members==null)
        {
-               members= new ArrayList<ServiceMembers>();
+               members= new ArrayList<>();
        }
         return this.members;
     }
index f64abb8..f80f519 100644 (file)
@@ -38,7 +38,8 @@ public class ServiceListJson {
        public void setName(String value) {
                this.name = value;
        }
-       
+
+       @Override
        public boolean equals(Object obj){
                if(obj == null){
                        return false;
@@ -52,14 +53,15 @@ public class ServiceListJson {
                }
                return false;
        }
-       
-        public int hashCode() {
+
+       @Override
+       public int hashCode() {
                 if(name!=null){
                return Integer.valueOf(name.charAt(0)+(name.charAt(1)));
                 }else{
                         return 0;
                 }
-        }
+       }
        
        
        public String getDescription() {
index 7188e35..d709f0d 100644 (file)
@@ -67,7 +67,7 @@ public class Term {
     public  List<String> getFromZones() {
        if (fromZones==null)
        {
-               fromZones= new ArrayList<String>();
+               fromZones= new ArrayList<>();
        }
         return fromZones;
     }
@@ -80,7 +80,7 @@ public class Term {
     public  List<String> getToZones() {
        if (toZones==null)
        {
-               toZones= new ArrayList<String>();
+               toZones= new ArrayList<>();
        }
         return toZones;
     }
@@ -113,7 +113,7 @@ public class Term {
     {
        if(sourceList==null)
        {
-               sourceList= new ArrayList<AddressJson>();
+               sourceList= new ArrayList<>();
        }
         return this.sourceList;
     }
@@ -127,7 +127,7 @@ public class Term {
     {
        if(destinationList==null)
        {
-               destinationList= new ArrayList<AddressJson>();
+               destinationList= new ArrayList<>();
        }
         return this.destinationList;
     }
@@ -140,7 +140,7 @@ public class Term {
     public List<ServicesJson> getSourceServices() {
        if(sourceServices==null)
        {
-               sourceServices= new ArrayList<ServicesJson>();
+               sourceServices= new ArrayList<>();
        }
         return this.sourceServices;
     }
@@ -153,7 +153,7 @@ public class Term {
     public Set<ServicesJson> getDestServices() {
        if(destServices==null)
        {
-               destServices= new HashSet<ServicesJson>();
+               destServices= new HashSet<>();
        }
         return this.destServices;
     }
index cfc91f0..76a80cb 100644 (file)
@@ -90,7 +90,7 @@ public class TermCollector {
        public Set<Object> getServiceGroups() {
                if(serviceGroups==null)
                {
-                       serviceGroups= new HashSet<Object>();
+                       serviceGroups= new HashSet<>();
                }
                return this.serviceGroups;
        }
@@ -103,7 +103,7 @@ public class TermCollector {
        public Set<Object> getAddressGroups() {
                if(addressGroups==null)
                {
-                       addressGroups= new HashSet<Object>();
+                       addressGroups= new HashSet<>();
                }
                return this.addressGroups;
        }
@@ -117,7 +117,7 @@ public class TermCollector {
 
                if(firewallRuleList==null)
                {
-                       firewallRuleList= new ArrayList<Term>();
+                       firewallRuleList= new ArrayList<>();
                }
                return this.firewallRuleList;
        }
index 740aa83..a9c645e 100644 (file)
@@ -25,7 +25,7 @@ import java.util.List;
 
 public class VendorSpecificData {
 
-       private List<IdMap> idMap= new ArrayList<IdMap>();
+       private List<IdMap> idMap= new ArrayList<>();
 
        public List<IdMap> getIdMap() {
                return idMap;
index d1ed7f6..df6bf12 100644 (file)
@@ -29,6 +29,7 @@ public class PolicyDBException extends Exception {
     private static final long serialVersionUID = -6162444281003852781L;
 
     public PolicyDBException() {
+        // Empty constructor
     }
     
     public PolicyDBException(String message) {
index 1c1c3f4..9336a90 100644 (file)
@@ -90,6 +90,7 @@ public class ActionBodyEntity implements Serializable {
        private boolean deleted = false;
 
        public ActionBodyEntity() {
+               //An empty constructor
        }
 
        @PrePersist
@@ -110,7 +111,7 @@ public class ActionBodyEntity implements Serializable {
                return actionBodyId;
        }
        /**
-        * @param configurationDataId the configurationDataId to set
+        * @param name the configuration body name to set
         */
        public void setActionBodyName(String name) {
                this.actionBodyName = name;
@@ -126,7 +127,7 @@ public class ActionBodyEntity implements Serializable {
                return actionBody;
        }
        /**
-        * @param configBody the configBody to set
+        * @param body the configBody to set
         */
        public void setActionBody(String body) {
                this.actionBody = body;
@@ -213,8 +214,7 @@ public class ActionBodyEntity implements Serializable {
                        return false;
                }
 
-               return (
-                               actionBodyId == ((ActionBodyEntity) obj).actionBodyId &&
+               return  actionBodyId == ((ActionBodyEntity) obj).actionBodyId &&
                                actionBodyName.equals(((ActionBodyEntity) obj).actionBodyName) && 
                                version == ((ActionBodyEntity) obj).version && 
                                actionBody.equals(((ActionBodyEntity) obj).actionBody) && 
@@ -222,7 +222,6 @@ public class ActionBodyEntity implements Serializable {
                                createdDate.equals(((ActionBodyEntity) obj).createdDate) && 
                                modifiedBy.equals(((ActionBodyEntity) obj).modifiedBy) &&
                                modifiedDate.equals(((ActionBodyEntity) obj).modifiedDate) &&
-                               deleted == ((ActionBodyEntity) obj).deleted
-                               );
+                               deleted == ((ActionBodyEntity) obj).deleted;
        }
 }
index 6be8cd7..7d46330 100644 (file)
@@ -53,28 +53,25 @@ public class ActionList implements Serializable {
        
        @Column(name="description")
        private String description;
-/*
-       @Temporal(TemporalType.TIMESTAMP)
-       @Column(name="modified_date", nullable=false)
-       private Date modifiedDate;*/
 
        public ActionList() {
-               
+               //An empty constructor
        }
        public ActionList(String string, String userid) {
                this(domain);
                
        }
        public ActionList(String domain) {
-               
+               //An empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               //An empty function
        }
        @PreUpdate
        public void preUpdate() {
+               //An empty function
        }
        public String getActionName() {
                return this.actionName;
index bf8a731..fff1bf8 100644 (file)
@@ -118,7 +118,7 @@ public class ActionPolicyDict implements Serializable {
 
        private static Log logger = LogFactory.getLog(ActionPolicyDict.class);
        public ActionPolicyDict() {
-               
+               //An empty constructor
        }
        
        public ActionPolicyDict(String string, String userid) {
@@ -138,10 +138,9 @@ public class ActionPolicyDict implements Serializable {
        public void preUpdate() {
                this.modifiedDate = new Date();
                try {
-                       this.userModifiedBy =XacmlAdminAuthorization.getUserId();;
+                       this.userModifiedBy =XacmlAdminAuthorization.getUserId();
                } catch (Exception e) {
                        logger.error("Exception caused While adding Modified by Role"+e);
-                       //PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "ActionPolicyDict", "Exception caused While adding Modified by Role");
                }
        }
        public int getId() {
index 2a14e70..c3673f3 100644 (file)
@@ -59,22 +59,23 @@ public class AddressGroup implements Serializable {
        private String description;
        
        public AddressGroup() {
-               
+               //An empty constructor
        }
        public AddressGroup(String string, String userid) {
                this(domain);
                
        }
        public AddressGroup(String domain) {
-               
+               //An empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               //An empty function
        }
        @PreUpdate
        public void preUpdate() {
+               //An empty function
        }
 
        
index 7285e2e..ea89eea 100644 (file)
@@ -151,6 +151,7 @@ public class Attribute implements Serializable {
 
        
        public Attribute() {
+               //An empty constructor
        }
        
        public Attribute(String domain) {
@@ -230,11 +231,7 @@ public class Attribute implements Serializable {
        public String getXacmlId() {
                return this.xacmlId;
        }
-       
-/*     @Transient
-       public Identifier getXacmlIdentifier() {
-               return new IdentifierImpl(this.xacmlId);
-       }*/
+
 
        public void setXacmlId(String xacmlId) {
                this.xacmlId = xacmlId;
@@ -332,7 +329,7 @@ public class Attribute implements Serializable {
 
        @Transient
        public boolean isDesignator() {
-               return (this.isDesignator == '1');
+               return this.isDesignator == '1';
        }
        
        @Transient
index 7a1be9e..75e3d68 100644 (file)
@@ -65,6 +65,7 @@ public class AttributeAssignment implements Serializable {
        private Obadvice obadvice;
 
        public AttributeAssignment() {
+               //An empty constructor
        }
 
        public int getId() {
index 5a78df2..8dd2a59 100644 (file)
@@ -87,10 +87,11 @@ public class BRMSParamTemplate implements Serializable{
        }
        
        public BRMSParamTemplate(){
+               //An empty constructor
        }
        
        public BRMSParamTemplate(String userid){
-               
+               //An empty constructor
        }
        
        @PrePersist
index 1d0f0e4..275b03e 100644 (file)
@@ -170,12 +170,12 @@ public class Category implements Serializable {
 
        @Transient
        public boolean isStandard() {
-               return (this.isStandard == Category.STANDARD);
+               return this.isStandard == Category.STANDARD;
        }
        
        @Transient
        public boolean isCustom() {
-               return (this.isStandard == Category.CUSTOM);
+               return this.isStandard == Category.CUSTOM;
        }
        
        @Transient
index f4ade22..c69476f 100644 (file)
@@ -103,7 +103,7 @@ public class ClosedLoopD2Services implements Serializable{
        private static Log LOGGER = LogFactory.getLog(ClosedLoopD2Services.class);
        
        public ClosedLoopD2Services(){
-               
+               //An empty constructor
        }
        
        public ClosedLoopD2Services(String string, String userid) {
index 6fbf9fb..c3acf9a 100644 (file)
@@ -105,7 +105,7 @@ public class ClosedLoopSite implements Serializable{
        private static Log LOGGER = LogFactory.getLog(ClosedLoopSite.class);
        
        public ClosedLoopSite(){
-               
+               //An empty constructor
        }
        
        public ClosedLoopSite(String string, String userid) {
index bb5b4bd..53695d8 100644 (file)
@@ -61,7 +61,7 @@ public class ClosedLoops implements Serializable {
        private String yaml;
                
        public ClosedLoops() {
-               
+               //An empty constructor
        }
 
        public int getId() {
index 3386e9a..4c15c52 100644 (file)
@@ -97,6 +97,7 @@ public class ConfigurationDataEntity implements Serializable {
        private boolean deleted = false;
 
        public ConfigurationDataEntity() {
+               //An empty constructor
        }
 
        @PrePersist
@@ -242,8 +243,7 @@ public class ConfigurationDataEntity implements Serializable {
                        return false;
                }
                
-               return (
-                               configurationDataId == ((ConfigurationDataEntity) obj).configurationDataId &&   
+               return configurationDataId == ((ConfigurationDataEntity) obj).configurationDataId &&
                                configurationName.equals(((ConfigurationDataEntity) obj).configurationName) && 
                                version == ((ConfigurationDataEntity) obj).version &&
                                configType.equals(((ConfigurationDataEntity) obj).configType) &&
@@ -253,7 +253,6 @@ public class ConfigurationDataEntity implements Serializable {
                                description.equals(((ConfigurationDataEntity) obj).description) &&
                                modifiedBy.equals(((ConfigurationDataEntity) obj).modifiedBy) &&
                                modifiedDate.equals(((ConfigurationDataEntity) obj).modifiedDate) &&
-                               deleted == ((ConfigurationDataEntity) obj).deleted
-                               );
+                               deleted == ((ConfigurationDataEntity) obj).deleted;
        }
 }
index eeadeb0..77e8839 100644 (file)
@@ -69,7 +69,7 @@ public class ConstraintType implements Serializable {
        private Set<Attribute> attributes = new HashSet<>();
 
        public ConstraintType() {
-               
+               //An empty constructor
        }
 
        public ConstraintType(String constraintType) {
index 57e9af8..4943a41 100644 (file)
@@ -60,6 +60,7 @@ public class ConstraintValue implements Serializable {
        private Attribute attribute;
 
        public ConstraintValue() {
+               //An empty constructor
        }
 
        public ConstraintValue(String property, String value) {
index 27d5d27..1b08c1c 100644 (file)
@@ -57,22 +57,23 @@ public class DCAEUsers implements Serializable {
 
 
        public DCAEUsers() {
-               
+               //An empty constructor
        }
        public DCAEUsers(String string, String userid) {
                this(domain);
                
        }
        public DCAEUsers(String domain) {
-               
+               //An empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               //An empty function
        }
        @PreUpdate
        public void preUpdate() {
+               //An empty function
        }
 
        
index b7f9243..dc69609 100644 (file)
@@ -57,22 +57,23 @@ public class DCAEuuid implements Serializable {
 
 
        public DCAEuuid() {
-               
+               //An empty constructor
        }
        public DCAEuuid(String string, String userid) {
                this(domain);
                
        }
        public DCAEuuid(String domain) {
-               
+               //An empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               //An empty function
        }
        @PreUpdate
        public void preUpdate() {
+               //An empty function
        }
 
        public String getDescription() {
index 7b5a895..4241888 100644 (file)
@@ -35,7 +35,7 @@ public class DatabaseLockEntity implements Serializable {
        @Column(name="lock_key")
        private int lock_key = 1;
        public DatabaseLockEntity(){
-               
+               //An empty constructor
        }
        public int getKey(){
                return lock_key;
index 6be1a84..15948bd 100644 (file)
@@ -222,12 +222,12 @@ public class Datatype implements Serializable {
 
        @Transient
        public boolean isStandard() {
-               return (this.isStandard == Datatype.STANDARD);
+               return this.isStandard == Datatype.STANDARD;
        }
        
        @Transient
        public boolean isCustom() {
-               return (this.isStandard == Datatype.CUSTOM);
+               return this.isStandard == Datatype.CUSTOM;
        }
 
        @Transient
@@ -237,8 +237,6 @@ public class Datatype implements Serializable {
                                + ", xacmlId=" + xacmlId + ", shortName=" + shortName
                                + ", attributes=" + attributes + ", functions=" + functions
                                + ", arguments=" + arguments + "]";
-                               
-               //return "Datatype [shortName=" + shortName + "]";
        }
 
 }
index 164cc3c..e0ed676 100644 (file)
@@ -110,6 +110,7 @@ public class DecisionSettings implements Serializable {
        }
        
        public DecisionSettings() {
+               //An empty constructor
        }
        
        public DecisionSettings(String domain) {
@@ -144,7 +145,7 @@ public class DecisionSettings implements Serializable {
        public void preUpdate() {
                this.modifiedDate = new Date();
                try {
-                       this.userModifiedBy = XacmlAdminAuthorization.getUserId();;
+                       this.userModifiedBy = XacmlAdminAuthorization.getUserId();
                } catch (Exception e) {
                        PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "DecisionSettings", "Exception caused While adding Modified by Role");
                }
@@ -186,11 +187,6 @@ public class DecisionSettings implements Serializable {
        public String getXacmlId() {
                return this.xacmlId;
        }
-       
-/*     @Transient
-       public Identifier getXacmlIdentifier() {
-               return new IdentifierImpl(this.xacmlId);
-       }*/
 
        public void setXacmlId(String xacmlId) {
                this.xacmlId = xacmlId;
index 30882fc..68a00db 100644 (file)
@@ -102,7 +102,7 @@ public class DescriptiveScope implements Serializable {
        private static Log LOGGER = LogFactory.getLog(DescriptiveScope.class);
        
        public DescriptiveScope(){
-               
+               //An empty constructor
        }
        
        public DescriptiveScope(String string, String userid) {
index 71f4d6a..ed69811 100644 (file)
@@ -100,7 +100,7 @@ public class FWTag implements Serializable {
        private static Log LOGGER = LogFactory.getLog(FWTag.class);
        
        public FWTag(){
-               
+               //An empty constructor
        }
        
        public FWTag(String string, String userid) {
index 6f03b49..6090558 100644 (file)
@@ -86,7 +86,7 @@ public class FWTagPicker implements Serializable {
        private static Log logger = LogFactory.getLog(FWTagPicker.class);
        
        public FWTagPicker(){
-               
+               //An empty constructor
        }
        
        public FWTagPicker(String string, String userid) {
index 27f5e75..5644d4a 100644 (file)
@@ -57,22 +57,6 @@ public class FirewallDictionaryList implements Serializable {
        
        @Column(name="serviceList")
        private String serviceList;
-       
-/*     @Temporal(TemporalType.TIMESTAMP)
-       @Column(name="created_date", updatable=false)
-       private Date createdDate;
-
-       @Temporal(TemporalType.TIMESTAMP)
-       @Column(name="modified_date", nullable=false)
-       private Date modifiedDate;
-       
-       @ManyToOne(optional = false)
-       @JoinColumn(name="created_by")
-       private UserInfo userCreatedBy;
-
-       @ManyToOne(optional = false)
-       @JoinColumn(name="modified_by")
-       private UserInfo userModifiedBy;*/
 
        public int getId() {
                return this.id;
@@ -113,26 +97,9 @@ public class FirewallDictionaryList implements Serializable {
        public void setServiceList(String serviceList) {
                this.serviceList = serviceList;
        }
-       
-       
-       /*public UserInfo getUserCreatedBy() {
-               return userCreatedBy;
-       }
-
-       public void setUserCreatedBy(UserInfo userCreatedBy) {
-               this.userCreatedBy = userCreatedBy;
-       }
-
-       public UserInfo getUserModifiedBy() {
-               return userModifiedBy;
-       }
-
-       public void setUserModifiedBy(UserInfo userModifiedBy) {
-               this.userModifiedBy = userModifiedBy;
-       }*/
 
        public FirewallDictionaryList() {
-               
+               //An empty constructor
        }
        
        public FirewallDictionaryList(String string, String userid) {
@@ -142,23 +109,4 @@ public class FirewallDictionaryList implements Serializable {
                this.parentItemName = domain;
        }       
 
-       /*@PrePersist
-       public void     prePersist() {
-               Date date = new Date();
-               this.createdDate = date;
-               this.modifiedDate = date;
-               auditLogger.debug("Added New Term Name: "+this.parentItemName+" by "+this.userCreatedBy);
-               
-       }
-       @PreUpdate
-       public void preUpdate() {
-               this.modifiedDate = new Date();
-               try {
-                       this.userModifiedBy =XacmlAdminAuthorization.getUserId();;
-               } catch (Exception e) {
-                       PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "TermList", "Exception caused While adding Modified by Role");
-               }
-               auditLogger.debug("Updated Term Name: "+this.parentItemName+" by "+this.userModifiedBy);
-       }
-*/
 }
index 4d71299..dd45356 100644 (file)
@@ -57,6 +57,7 @@ public class FunctionArgument implements Serializable {
        private Datatype datatypeBean;
 
        public FunctionArgument() {
+               //An empty constructor
        }
 
        public FunctionArgument(final FunctionArgument argument) {
index c3dfcaa..d2fa034 100644 (file)
@@ -81,6 +81,7 @@ public class FunctionDefinition implements Serializable {
        private List<FunctionArgument> functionArguments;
 
        public FunctionDefinition() {
+               //An empty constructor
        }
 
        public int getId() {
index 44f27ba..55c3bd6 100644 (file)
@@ -59,22 +59,23 @@ public class GroupPolicyScopeList implements Serializable {
        private String description;
 
        public GroupPolicyScopeList() {
-               
+               //An empty constructor
        }
        public GroupPolicyScopeList(String string, String userid) {
                this(domain);
                
        }
        public GroupPolicyScopeList(String domain) {
-               
+               //An empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               //An empty function
        }
        @PreUpdate
        public void preUpdate() {
+               //An empty function
        }
 
        
index 53fb89d..4d1560f 100644 (file)
@@ -57,22 +57,23 @@ public class GroupServiceList implements Serializable {
        
 
        public GroupServiceList() {
-               
+               //An empty constructor
        }
        public GroupServiceList(String string, String userid) {
                this(domain);
                
        }
        public GroupServiceList(String domain) {
-               
+               //An empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               //An empty function
        }
        @PreUpdate
        public void preUpdate() {
+               //An empty function
        }
 
        
index bb05071..88db4dd 100644 (file)
@@ -58,22 +58,23 @@ public class MicroServiceAttribute implements Serializable {
        
 
        public MicroServiceAttribute() {
-               
+               //An empty constructor
        }
        public MicroServiceAttribute(String string, String userid) {
                this(domain);
                
        }
        public MicroServiceAttribute(String domain) {
-               
+               //An empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               //An empty function
        }
        @PreUpdate
        public void preUpdate() {
+               //An empty function
        }
 
        
index f47b96e..90a066b 100644 (file)
@@ -57,22 +57,23 @@ public class MicroServiceConfigName implements Serializable {
 
 
        public MicroServiceConfigName() {
-               
+               //An empty constructor
        }
        public MicroServiceConfigName(String string, String userid) {
                this(domain);
                
        }
        public MicroServiceConfigName(String domain) {
-               
+               //An empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               //An empty function
        }
        @PreUpdate
        public void preUpdate() {
+               //An empty function
        }
 
        
index 4d82a3b..130de0a 100644 (file)
@@ -57,22 +57,23 @@ public class MicroServiceLocation implements Serializable {
 
 
        public MicroServiceLocation() {
-               
+               //An empty constructor
        }
        public MicroServiceLocation(String string, String userid) {
                this(domain);
                
        }
        public MicroServiceLocation(String domain) {
-               
+               //An empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               //An empty function
        }
        @PreUpdate
        public void preUpdate() {
+               //An empty function
        }
 
        
index 5137997..ff4028f 100644 (file)
@@ -117,10 +117,11 @@ public class MicroServiceModels implements Serializable{
        }
        
        public MicroServiceModels(){
+               //An empty constructor
        }
        
        public MicroServiceModels(String userid){
-       
+               //An empty constructor
        }
 
        public String getAttributes() {
index 8d5be97..7b0db3f 100644 (file)
@@ -63,12 +63,6 @@ public class ObadviceExpression implements Serializable {
 
        @Column(name="type", nullable=false)
        private String type;
-       
-       /*
-       @Lob
-       @Column(name="expression", nullable=false)
-       private byte[] expression;
-       */
 
        //bi-directional many-to-one association to Obadvice
        @ManyToOne
index a4c0c85..66ee346 100644 (file)
@@ -97,7 +97,7 @@ public class OnapName implements Serializable {
        }
        
        public OnapName() {
-               
+               //An empty constructor
        }
        
        public OnapName(String string, String userid) {
index c1fff14..869386f 100644 (file)
@@ -104,7 +104,7 @@ public class PEPOptions implements Serializable {
        private static Log LOGGER = LogFactory.getLog(PEPOptions.class);
        
        public PEPOptions(){
-               
+               //An empty constructor
        }
        
        public PEPOptions(String string, String userid) {
index 1540c8a..fb18f70 100644 (file)
@@ -58,6 +58,7 @@ public class PIPConfigParam implements Serializable {
        private PIPConfiguration pipconfiguration;
 
        public PIPConfigParam() {
+               //An empty constructor
        }
 
        public PIPConfigParam(String param) {
@@ -125,7 +126,7 @@ public class PIPConfigParam implements Serializable {
 
        @Transient
        public boolean isRequired() {
-               return (this.required == '1');
+               return this.required == '1';
        }
        
        @Transient
index 5d73155..01f5cfc 100644 (file)
@@ -124,6 +124,7 @@ public class PIPConfiguration implements Serializable {
        private Set<PIPResolver> pipresolvers = new HashSet<>();
 
        public PIPConfiguration() {
+               //An empty constructor
        }
        
        public PIPConfiguration(PIPConfiguration config, String user) {
@@ -316,7 +317,7 @@ public class PIPConfiguration implements Serializable {
 
        @Transient
        public boolean isReadOnly() {
-               return (this.readOnly == '1');
+               return this.readOnly == '1';
        }
        
        @Transient
@@ -330,7 +331,7 @@ public class PIPConfiguration implements Serializable {
        
        @Transient
        public boolean requiresResolvers() {
-               return (this.requiresResolvers == '1');
+               return this.requiresResolvers == '1';
        }
        
        @Transient
@@ -390,21 +391,21 @@ public class PIPConfiguration implements Serializable {
                //
                // Go through each property
                //
-               for (Object name : properties.keySet()) {
-                       if (name.toString().startsWith(id) == false) {
+               for (Object nme : properties.keySet()) {
+                       if (nme.toString().startsWith(id) == false) {
                                continue;
                        }
-                       if (name.equals(id + ".classname")) {
+                       if (nme.equals(id + ".classname")) {
                                //
                                // We already saved this
                                //
-                       } else if (name.equals(id + "." + StdConfigurableEngine.PROP_NAME)) {
-                               this.name = properties.getProperty(name.toString());
-                       } else if (name.equals(id + "." + StdConfigurableEngine.PROP_DESCRIPTION)) {
-                               this.description = properties.getProperty(name.toString());
-                       } else if (name.equals(id + "." + StdConfigurableEngine.PROP_ISSUER)) {
-                               this.issuer = properties.getProperty(name.toString());
-                       } else if (name.equals(id + ".resolvers")) {
+                       } else if (nme.equals(id + "." + StdConfigurableEngine.PROP_NAME)) {
+                               this.name = properties.getProperty(nme.toString());
+                       } else if (nme.equals(id + "." + StdConfigurableEngine.PROP_DESCRIPTION)) {
+                               this.description = properties.getProperty(nme.toString());
+                       } else if (nme.equals(id + "." + StdConfigurableEngine.PROP_ISSUER)) {
+                               this.issuer = properties.getProperty(nme.toString());
+                       } else if (nme.equals(id + ".resolvers")) {
                                //
                                // It has resolvers, make sure this is set to true if
                                // it has been already.
@@ -414,13 +415,13 @@ public class PIPConfiguration implements Serializable {
                                // Parse the resolvers
                                //
                                Collection<PIPResolver> resolvers = PIPResolver.importResolvers(id + ".resolver",
-                                                                                                                                               properties.getProperty(name.toString()),
+                                                                                                                                               properties.getProperty(nme.toString()),
                                                                                                                                                properties,"super-admin"
                                                                                                                                                );
                                for (PIPResolver resolver : resolvers) {
                                        this.addPipresolver(resolver);
                                }
-                       } else if (name.toString().startsWith(id + ".resolver")) {
+                       } else if (nme.toString().startsWith(id + ".resolver")) {
                                //
                                // Ignore, the PIPResolver will parse these values
                                //
@@ -428,8 +429,8 @@ public class PIPConfiguration implements Serializable {
                                //
                                // Config Parameter
                                //
-                               this.addPipconfigParam(new PIPConfigParam(name.toString().substring(id.length() + 1), 
-                                                                                                       properties.getProperty(name.toString())));
+                               this.addPipconfigParam(new PIPConfigParam(nme.toString().substring(id.length() + 1),
+                                                                                                       properties.getProperty(nme.toString())));
                        }
                }
                //
@@ -470,12 +471,12 @@ public class PIPConfiguration implements Serializable {
                Iterator<PIPResolver> iter = this.pipresolvers.iterator();
                while (iter.hasNext()) {
                        PIPResolver resolver = iter.next();
-                       String id = Integer.toString(resolver.getId());
-                       Map<String, String> resolverMap = resolver.getConfiguration(prefix + "resolver." + id);
+                       String idd = Integer.toString(resolver.getId());
+                       Map<String, String> resolverMap = resolver.getConfiguration(prefix + "resolver." + idd);
                        map.putAll(resolverMap);
-                       ids.add(id);
+                       ids.add(idd);
                }
-               if (ids.size() > 0) {
+               if (!ids.isEmpty()) {
                        map.put(prefix + "resolvers", Joiner.on(',').join(ids));
                }
                return map;
@@ -512,11 +513,11 @@ public class PIPConfiguration implements Serializable {
                Iterator<PIPResolver> iter = this.pipresolvers.iterator();
                while (iter.hasNext()) {
                        PIPResolver resolver = iter.next();
-                       String id = Integer.toString(resolver.getId());
-                       resolver.generateProperties(props, prefix + "resolver." + id);
-                       ids.add(id);
+                       String idd = Integer.toString(resolver.getId());
+                       resolver.generateProperties(props, prefix + "resolver." + idd);
+                       ids.add(idd);
                }
-               if (ids.size() > 0) {
+               if (!ids.isEmpty()) {
                        props.setProperty(prefix + "resolvers", Joiner.on(',').join(ids));
                }
                return props;
index daab6d6..4838639 100644 (file)
@@ -106,6 +106,7 @@ public class PIPResolver implements Serializable {
        private Set<PIPResolverParam> pipresolverParams = new HashSet<>();
 
        public PIPResolver() {
+               //An empty constructor
        }
        
        public PIPResolver(String prefix, Properties properties, String user) throws PIPException {
@@ -260,7 +261,7 @@ public class PIPResolver implements Serializable {
 
        @Transient
        public boolean isReadOnly() {
-               return (this.readOnly == '1');
+               return this.readOnly == '1';
        }
        
        @Transient
@@ -293,62 +294,64 @@ public class PIPResolver implements Serializable {
                //
                // Go through each property
                //
-               for (Object name : properties.keySet()) {
-                       if (name.toString().startsWith(prefix) == false) {
+               for (Object nme : properties.keySet()) {
+                       if (nme.toString().startsWith(prefix) == false) {
                                continue;
                        }
-                       if (name.equals(prefix + ".classname")) {
+                       if (nme.equals(prefix + ".classname")) {
                                //
                                // We already saved this
                                //
-                       } else if (name.equals(prefix + "." + StdConfigurableEngine.PROP_NAME)) {
-                               this.name = properties.getProperty(name.toString());
-                       } else if (name.equals(prefix + "." + StdConfigurableEngine.PROP_DESCRIPTION)) {
-                               this.description = properties.getProperty(name.toString());
-                       } else if (name.equals(prefix + "." + StdConfigurableEngine.PROP_ISSUER)) {
-                               this.issuer = properties.getProperty(name.toString());
+                       } else if (nme.equals(prefix + "." + StdConfigurableEngine.PROP_NAME)) {
+                               this.name = properties.getProperty(nme.toString());
+                       } else if (nme.equals(prefix + "." + StdConfigurableEngine.PROP_DESCRIPTION)) {
+                               this.description = properties.getProperty(nme.toString());
+                       } else if (nme.equals(prefix + "." + StdConfigurableEngine.PROP_ISSUER)) {
+                               this.issuer = properties.getProperty(nme.toString());
                        } else {
-                               this.addPipresolverParam(new PIPResolverParam(name.toString().substring(prefix.length() + 1),
-                                                                                                                       properties.getProperty(name.toString())));
+                               this.addPipresolverParam(new PIPResolverParam(nme.toString().substring(prefix.length() + 1),
+                                                                                                                       properties.getProperty(nme.toString())));
                        }
                }
        }
 
        @Transient
        public Map<String, String> getConfiguration(String prefix) {
+               String pref = prefix;
                Map<String, String> map = new HashMap<>();
                if (prefix.endsWith(".") == false) {
-                       prefix = prefix + ".";
+                       pref = prefix + ".";
                }
-               map.put(prefix + "classname", this.classname);
-               map.put(prefix + "name", this.name);
+               map.put(pref + "classname", this.classname);
+               map.put(pref + "name", this.name);
                if (this.description != null) {
-                       map.put(prefix + "description", this.description);
+                       map.put(pref + "description", this.description);
                }
                if (this.issuer != null && this.issuer.isEmpty() != false) {
-                       map.put(prefix + "issuer", this.issuer);
+                       map.put(pref + "issuer", this.issuer);
                }
                for (PIPResolverParam param : this.pipresolverParams) {
-                       map.put(prefix + param.getParamName(), param.getParamValue());
+                       map.put(pref + param.getParamName(), param.getParamValue());
                }
                return map;
        }
 
        @Transient
        public void     generateProperties(Properties props, String prefix) {
+               String pref = prefix;
                if (prefix.endsWith(".") == false) {
-                       prefix = prefix + ".";
+                       pref = prefix + ".";
                }
-               props.setProperty(prefix + "classname", this.classname);
-               props.setProperty(prefix + "name", this.name);
+               props.setProperty(pref + "classname", this.classname);
+               props.setProperty(pref + "name", this.name);
                if (this.description != null) {
-                       props.setProperty(prefix + "description", this.description);
+                       props.setProperty(pref + "description", this.description);
                }
                if (this.issuer != null && this.issuer.isEmpty() != false) {
-                       props.setProperty(prefix + "issuer", this.issuer);
+                       props.setProperty(pref + "issuer", this.issuer);
                }
                for (PIPResolverParam param : this.pipresolverParams) {
-                       props.setProperty(prefix + param.getParamName(), param.getParamValue());
+                       props.setProperty(pref + param.getParamName(), param.getParamValue());
                }
        }
 
index 8dec791..3db0e0f 100644 (file)
@@ -58,6 +58,7 @@ public class PIPResolverParam implements Serializable {
        private PIPResolver pipresolver;
 
        public PIPResolverParam() {
+               // Empty constructor
        }
 
        public PIPResolverParam(String name) {
index 0ef4388..61ab9ff 100644 (file)
@@ -63,6 +63,7 @@ public class PIPType implements Serializable {
        private Set<PIPConfiguration> pipconfigurations;
 
        public PIPType() {
+               // Empty constructor
        }
 
        public int getId() {
index 4488fcd..c21b832 100644 (file)
@@ -89,12 +89,12 @@ public class PolicyAlgorithms implements Serializable {
 
        @Transient
        public boolean isStandard() {
-               return (this.isStandard == PolicyAlgorithms.STANDARD);
+               return this.isStandard == PolicyAlgorithms.STANDARD;
        }
        
        @Transient
        public boolean isCustom() {
-               return (this.isStandard == PolicyAlgorithms.CUSTOM);
+               return this.isStandard == PolicyAlgorithms.CUSTOM;
        }
 
        public String getXacmlId() {
index bfb4218..698ec36 100644 (file)
@@ -79,7 +79,8 @@ public class PolicyEditorScopes implements Serializable{
        @JoinColumn(name="modified_by")
        private UserInfo userModifiedBy;
        
-       public PolicyEditorScopes() {           
+       public PolicyEditorScopes() {
+               // Empty constructor
        }
        
        public PolicyEditorScopes(String string, String userid) {
index 6c7b8cf..c262aec 100644 (file)
@@ -310,8 +310,7 @@ public class PolicyEntity implements Serializable {
 
                PolicyEntity p = (PolicyEntity) obj;
                
-               return (
-                               policyId == p.policyId &&
+               return policyId == p.policyId &&
                                policyName.equals(p.policyName) &&
                                scope.equals(p.scope) &&
                                version == p.version &&
@@ -324,8 +323,7 @@ public class PolicyEntity implements Serializable {
                                description.equals(p.description) &&
                                modifiedBy.equals(p.modifiedBy) &&
                                modifiedDate.equals(p.modifiedDate) &&
-                               deleted == p.deleted
-                               );
+                               deleted == p.deleted;
        }
 
 
index 99d6075..e7230d6 100644 (file)
@@ -73,6 +73,7 @@ public class PolicyRoles implements Serializable {
        private String role;
        
        public PolicyRoles() {
+               // Empty constructor
        }
 
        public int getId() {
index 6fc45eb..9f437ce 100644 (file)
@@ -56,22 +56,23 @@ public class PolicyScopeClosedLoop implements Serializable {
        private String description ;
 
        public PolicyScopeClosedLoop() {
-               
+               // Empty constructor
        }
        public PolicyScopeClosedLoop(String string, String userid) {
                this(domain);
                
        }
        public PolicyScopeClosedLoop(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        
index f9ec945..9d71600 100644 (file)
@@ -56,22 +56,23 @@ public class PolicyScopeResource implements Serializable {
        private String description ;
 
        public PolicyScopeResource() {
-               
+               // Empty constructor
        }
        public PolicyScopeResource(String string, String userid) {
                this(domain);
                
        }
        public PolicyScopeResource(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        
index 84e8557..ec95d16 100644 (file)
@@ -56,22 +56,23 @@ public class PolicyScopeService implements Serializable {
        private String description ;
 
        public PolicyScopeService() {
-               
+               // Empty constructor
        }
        public PolicyScopeService(String string, String userid) {
                this(domain);
                
        }
        public PolicyScopeService(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        
index 48f17b0..92252b0 100644 (file)
@@ -56,22 +56,23 @@ public class PolicyScopeType implements Serializable {
        private String description ;
 
        public PolicyScopeType() {
-               
+               // Empty constructor
        }
        public PolicyScopeType(String string, String userid) {
                this(domain);
                
        }
        public PolicyScopeType(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        
index 3ad4b9b..a9e7765 100644 (file)
@@ -62,7 +62,7 @@ public class PolicyScore implements Serializable {
        private String PolicyScore;
        
        public PolicyScore() {
-               
+               // Empty constructor
        }
        
        public PolicyScore(String pName, String pScore) {
@@ -70,7 +70,7 @@ public class PolicyScore implements Serializable {
                
        }
        public PolicyScore(String domain) {
-               
+               // Empty constructor
        }
        
        public int getId() {
index dd51bee..663d34a 100644 (file)
@@ -21,7 +21,6 @@
 package org.onap.policy.rest.jpa;
 
 import java.io.Serializable;
-//import java.sql.Clob;
 import java.sql.Timestamp;
 import java.util.Date;
 import java.util.Objects;
@@ -109,7 +108,7 @@ public class PolicyVersion implements Serializable {
        }
        
        public PolicyVersion(){
-               
+               // Empty constructor
        }
        
        @PrePersist
@@ -122,14 +121,6 @@ public class PolicyVersion implements Serializable {
        @PreUpdate
        public void preUpdate() {
                this.modifiedDate =  new Date();
-               /*
-                * The modifiedBy must be set via the setModifiedBy() method since PolicyVersion
-                * has been moved to XACML-REST module for access from the XACML-PAP-REST module
-                
-                  String userid = ((XacmlAdminUI) UI.getCurrent()).getLoginUserId();
-                  this.modifiedBy =userid;
-                * 
-                */
        }
        
        public int getId() {
@@ -200,16 +191,14 @@ public class PolicyVersion implements Serializable {
 
                PolicyVersion p = (PolicyVersion) obj;
                
-               return (
-                               id == p.id &&
+               return id == p.id &&
                                policyName.equals(p.policyName) &&
                                activeVersion == p.activeVersion &&
                                higherVersion == p.higherVersion &&
                                createdDate.equals(p.createdDate) &&
                                createdBy.equals(p.createdBy) &&
                                modifiedDate.equals(p.modifiedDate) &&
-                               modifiedBy.equals(p.modifiedBy)
-                               );
+                               modifiedBy.equals(p.modifiedBy);
        }
 
 }
index 5d2f354..e696b1d 100644 (file)
@@ -59,22 +59,23 @@ public class PortList implements Serializable {
        private Date modifiedDate;*/
 
        public PortList() {
-               
+               // Empty constructor
        }
        public PortList(String string, String userid) {
                this(domain);
                
        }
        public PortList(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        
index 98e9402..16ef24c 100644 (file)
@@ -56,28 +56,25 @@ public class PrefixList implements Serializable {
        
        @Column(name="pl_value", nullable=false)
        private String prefixListValue;
-/*
-       @Temporal(TemporalType.TIMESTAMP)
-       @Column(name="modified_date", nullable=false)
-       private Date modifiedDate;*/
 
        public PrefixList() {
-               
+               // Empty constructor
        }
        public PrefixList(String string, String userid) {
                this(domain);
                
        }
        public PrefixList(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
        public String getPrefixListName() {
                return this.prefixListName;
index befea36..b74bb4a 100644 (file)
@@ -53,28 +53,25 @@ public class ProtocolList implements Serializable {
        
        @Column(name="description")
        private String description;
-/*
-       @Temporal(TemporalType.TIMESTAMP)
-       @Column(name="modified_date", nullable=false)
-       private Date modifiedDate;*/
 
        public ProtocolList() {
-               
+               // Empty constructor
        }
        public ProtocolList(String string, String userid) {
                this(domain);
                
        }
        public ProtocolList(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
        public String getProtocolName() {
                return this.protocolName;
index 383eb11..6761fe9 100644 (file)
@@ -61,7 +61,7 @@ public class RainyDayTreatments implements Serializable {
        private String treatments;
                
        public RainyDayTreatments() {
-               
+               // Empty constructor
        }
 
        public int getId() {
index f0443c0..7d34795 100644 (file)
@@ -57,22 +57,23 @@ public class RemoteCatalogValues implements Serializable {
 
 
        public RemoteCatalogValues() {
-               
+               // Empty constructor
        }
        public RemoteCatalogValues(String string, String userid) {
                this(domain);
                
        }
        public RemoteCatalogValues(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        public String getValue() {
index 1553726..a65e41f 100644 (file)
@@ -101,7 +101,7 @@ public class RiskType implements Serializable {
        private static Log LOGGER = LogFactory.getLog(RiskType.class);
        
        public RiskType() {
-               
+               // Empty constructor
        }
        
        public RiskType(String string, String userid) {
index 83f6e2d..9d0f005 100644 (file)
@@ -98,12 +98,12 @@ public class RuleAlgorithms implements Serializable {
        
        @Transient
        public boolean isStandard() {
-               return (this.isStandard == RuleAlgorithms.STANDARD);
+               return this.isStandard == RuleAlgorithms.STANDARD;
        }
        
        @Transient
        public boolean isCustom() {
-               return (this.isStandard == RuleAlgorithms.CUSTOM);
+               return this.isStandard == RuleAlgorithms.CUSTOM;
        }
 
        public String getXacmlId() {
index 1f92fe6..8b017c0 100644 (file)
@@ -65,22 +65,23 @@ public class SafePolicyWarning implements Serializable {
                this.riskType = riskType;
        }
        public SafePolicyWarning() {
-               
+               // Empty constructor
        }
        public SafePolicyWarning(String string, String userid) {
                this(domain);
                
        }
        public SafePolicyWarning(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        
index d8bc33c..cbbb896 100644 (file)
@@ -56,22 +56,23 @@ public class SecurityZone implements Serializable {
 
 
        public SecurityZone() {
-               
+               // Empty constructor
        }
        public SecurityZone(String string, String userid) {
                this(domain);
                
        }
        public SecurityZone(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        
index 40e3117..057b869 100644 (file)
@@ -65,31 +65,25 @@ public class ServiceList implements Serializable {
        
        @Column(name="ports")
        private String servicePorts;
-       
-       
-       
-/*
-       @Temporal(TemporalType.TIMESTAMP)
-       @Column(name="modified_date", nullable=false)
-       private Date modifiedDate;*/
 
        public ServiceList() {
-               
+               // Empty constructor
        }
        public ServiceList(String string, String userid) {
                this(domain);
                
        }
        public ServiceList(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        
index c9a27ef..099257c 100644 (file)
@@ -128,7 +128,7 @@ public class TermList implements Serializable {
        private static Log LOGGER = LogFactory.getLog(TermList.class);
        
        public TermList() {
-               
+               // Empty constructor
        }
        
        private static final Log auditLogger = LogFactory
index 01df592..356ecb7 100644 (file)
@@ -57,22 +57,23 @@ public class VMType implements Serializable {
 
 
        public VMType() {
-               
+               // Empty constructor
        }
        public VMType(String string, String userid) {
                this(domain);
                
        }
        public VMType(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        public String getDescription() {
index cf1e6b8..d44e4b5 100644 (file)
@@ -102,7 +102,7 @@ public class VNFType implements Serializable  {
        private static Log LOGGER = LogFactory.getLog(VNFType.class);
        
        public VNFType() {
-               
+               // Empty constructor
        }
        
        public String getVnftype() {
index 5bfab17..df605ee 100644 (file)
@@ -101,7 +101,7 @@ public class VSCLAction implements Serializable  {
        private static Log LOGGER = LogFactory.getLog(VSCLAction.class);
        
        public VSCLAction() {
-               
+               // Empty constructor
        }
        
        public VSCLAction(String string, String userid) {
index 0ede025..376689e 100644 (file)
@@ -103,7 +103,7 @@ public class VarbindDictionary implements Serializable{
        private static Log LOGGER = LogFactory.getLog(VarbindDictionary.class);
        
        public VarbindDictionary() {
-               
+               // Empty constructor
        }
        
        public VarbindDictionary(String string, String userid) {
index 71b3526..7586dd8 100644 (file)
@@ -96,10 +96,9 @@ public class WatchPolicyNotificationTable implements Serializable{
                        return false;
                }
                
-               return(id == ((WatchPolicyNotificationTable)obj).id &&
+               return id == ((WatchPolicyNotificationTable)obj).id &&
                policyName.equals(((WatchPolicyNotificationTable)obj).policyName) && 
-               loginIds.equals(((WatchPolicyNotificationTable)obj).loginIds)
-               );
+               loginIds.equals(((WatchPolicyNotificationTable)obj).loginIds);
        }
        
        
index eb53c42..fe5d62a 100644 (file)
@@ -56,22 +56,23 @@ public class Zone implements Serializable {
 
 
        public Zone() {
-               
+               // Empty constructor
        }
        public Zone(String string, String userid) {
                this(domain);
                
        }
        public Zone(String domain) {
-               
+               // Empty constructor
        }       
 
        @PrePersist
        public void     prePersist() {
-               
+               // Empty function
        }
        @PreUpdate
        public void preUpdate() {
+               // Empty function
        }
 
        
index b5d359f..3410dd7 100644 (file)
@@ -26,18 +26,18 @@ import java.util.Map;
 public class MSAttributeObject {
 
        private String className;
-       private HashMap<String, String> attribute = new HashMap<>();
-       private HashMap<String, String> refAttribute = new HashMap<>();
-       private HashMap<String, Object> subClass = new HashMap<>();
+       private Map<String, String> attribute = new HashMap<>();
+       private Map<String, String> refAttribute = new HashMap<>();
+       private Map<String, Object> subClass = new HashMap<>();
        private String dependency;
-       private HashMap<String, String> enumType = new HashMap<>();
-       private HashMap<String, String> matchingSet = new HashMap<>();
+       private Map<String, String> enumType = new HashMap<>();
+       private Map<String, String> matchingSet = new HashMap<>();
        private boolean policyTempalate; 
        
        public Map<String, String> getRefAttribute() {
                return refAttribute;
        }
-       public void setRefAttribute(HashMap<String, String> refAttribute) {
+       public void setRefAttribute(Map<String, String> refAttribute) {
                this.refAttribute = refAttribute;
        }
        public String getClassName() {
@@ -49,13 +49,13 @@ public class MSAttributeObject {
        public Map<String, String> getAttribute() {
                return attribute;
        }
-       public void setAttribute(HashMap<String, String> attribute) {
+       public void setAttribute(Map<String, String> attribute) {
                this.attribute = attribute;
        }
-       public HashMap<String, String> getEnumType() {
+       public Map<String, String> getEnumType() {
                return enumType;
        }
-       public void setEnumType(HashMap<String, String> enumType) {
+       public void setEnumType(Map<String, String> enumType) {
                this.enumType = enumType;
        }
        public void addAttribute(String key, String value){
@@ -70,13 +70,13 @@ public class MSAttributeObject {
        public void addAllRefAttribute(Map<String, String> map){
                this.refAttribute.putAll(map);
        }
-       public HashMap<String, Object> getSubClass() {
+       public Map<String, Object> getSubClass() {
                return subClass;
        }
-       public void setSubClass(HashMap<String, Object> subClass) {
+       public void setSubClass(Map<String, Object> subClass) {
                this.subClass = subClass;
        }
-       public void addAllSubClass(HashMap<String, Object> subClass){
+       public void addAllSubClass(Map<String, Object> subClass){
                this.subClass.putAll(subClass);
        }
        public String getDependency() {
@@ -88,16 +88,16 @@ public class MSAttributeObject {
        public void addSingleEnum(String key, String value){
                this.enumType.put(key, value);
        }
-       public HashMap<String, String> getMatchingSet() {
+       public Map<String, String> getMatchingSet() {
                return matchingSet;
        }
-       public void setMatchingSet(HashMap<String, String> matchingSet) {
+       public void setMatchingSet(Map<String, String> matchingSet) {
                this.matchingSet = matchingSet;
        }
        public void addMatchingSet(String key, String value){
                this.matchingSet.put(key, value);
        }
-       public void addMatchingSet(HashMap<String, String> matchingSet){
+       public void addMatchingSet(Map<String, String> matchingSet){
                this.matchingSet.putAll(matchingSet);
        }
        public boolean isPolicyTempalate() {
index fa2c51d..3880b35 100644 (file)
@@ -86,7 +86,7 @@ public class MSModelUtils {
        };
 
 
-       public HashMap<String, MSAttributeObject> processEpackage(String file, MODEL_TYPE model){
+       public Map<String, MSAttributeObject> processEpackage(String file, MODEL_TYPE model){
                if (model == MODEL_TYPE.XMI ){
                        processXMIEpackage(file);
                }
@@ -97,8 +97,8 @@ public class MSModelUtils {
        private void processXMIEpackage(String xmiFile){
                EPackage root = getEpackage(xmiFile);
                TreeIterator<EObject> treeItr = root.eAllContents();
-               String className = null;
-               String returnValue = null;
+               String className;
+               String returnValue;
 
                //    Pulling out dependency from file
                while (treeItr.hasNext()) {         
@@ -151,15 +151,13 @@ public class MSModelUtils {
 
 
        private void UpdateMatching(HashMap<String, String> tempAttribute, String key) {
-               Map<String, MSAttributeObject> newClass = null;
-
-               newClass = classMap;
+               Map<String, MSAttributeObject> newClass = classMap;
 
                for (Entry<String, MSAttributeObject> updateClass :  newClass.entrySet()){
-                       HashMap<String, String> valueMap = updateClass.getValue().getMatchingSet();
+                       Map<String, String> valueMap = updateClass.getValue().getMatchingSet();
                        String keymap = updateClass.getKey();
                        if (valueMap.containsKey(key)){
-                               HashMap<String, String> modifyMap = classMap.get(keymap).getMatchingSet();
+                               Map<String, String> modifyMap = classMap.get(keymap).getMatchingSet();
                                modifyMap.remove(key);
                                modifyMap.putAll(tempAttribute);
                                classMap.get(keymap).setMatchingSet(modifyMap);
@@ -181,7 +179,7 @@ public class MSModelUtils {
                m.put("xmi", new XMIResourceFactoryImpl());
                Resource resource = resSet.getResource(URI.createFileURI(xmiFile), true);
                try {
-                       resource.load(Collections.EMPTY_MAP);
+                       resource.load(Collections.emptyMap());
                } catch (IOException e) {
                        logger.error("Error loading Encore Resource for new Model" + e);
                }
@@ -210,14 +208,14 @@ public class MSModelUtils {
        public void getAttributes(String className, String dependency, EPackage root) {
                List<String> dpendList = new ArrayList<>();
                if (dependency!=null){
-                       dpendList = new ArrayList<String>(Arrays.asList(dependency.split(",")));
+                       dpendList = new ArrayList<>(Arrays.asList(dependency.split(",")));
                }
                MSAttributeObject msAttributeObject = new MSAttributeObject();
                msAttributeObject.setClassName(className);
                String extendClass = getSubTypes(root, className);
-               HashMap<String, String> returnRefList = getRefAttributeList(root, className, extendClass);
-               HashMap<String, String> returnAttributeList = getAttributeList(root, className, extendClass);
-               HashMap<String, Object> returnSubList = getSubAttributeList(root, className, extendClass);
+               Map<String, String> returnRefList = getRefAttributeList(root, className, extendClass);
+               Map<String, String> returnAttributeList = getAttributeList(root, className, extendClass);
+               Map<String, Object> returnSubList = getSubAttributeList(root, className, extendClass);
                HashMap<String, String> returnAnnotation = getAnnotation(root, className, extendClass);
                msAttributeObject.setAttribute(returnAttributeList);
                msAttributeObject.setRefAttribute(returnRefList);
@@ -234,9 +232,9 @@ public class MSModelUtils {
                boolean requiredAttribute = false; 
                boolean requiredMatchAttribute = false;
                HashMap<String, String> annotationSet = new HashMap<>();
-               String  matching  = null;
-               String range   = null;
-               String dictionary = null;
+               String  matching;
+               String range;
+               String dictionary;
 
                //    Pulling out dependency from file
                while (treeItr.hasNext()) {         
@@ -249,7 +247,7 @@ public class MSModelUtils {
                        if (requiredAttribute){
                                if (obj instanceof EStructuralFeature) {
                                        EStructuralFeature eStrucClassifier = (EStructuralFeature) obj;
-                                       if (eStrucClassifier.getEAnnotations().size() != 0) {
+                                       if (!eStrucClassifier.getEAnnotations().isEmpty()) {
                                                matching  = annotationValue(eStrucClassifier, ANNOTATION_TYPE.MATCHING, policy);
                                                if (matching!=null){
                                                        annotationSet.put(eStrucClassifier.getName(), matching);
@@ -267,7 +265,7 @@ public class MSModelUtils {
                        } else if (requiredMatchAttribute){
                                if (obj instanceof EStructuralFeature) {
                                        EStructuralFeature eStrucClassifier = (EStructuralFeature) obj;
-                                       if (eStrucClassifier.getEAnnotations().size() != 0) {
+                                       if (!eStrucClassifier.getEAnnotations().isEmpty()) {
                                                matching  = annotationValue(eStrucClassifier, ANNOTATION_TYPE.MATCHING, policy);
                                                if (matching!=null){
                                                        if (obj instanceof EReference){
@@ -285,13 +283,13 @@ public class MSModelUtils {
                return annotationSet;
        }
 
-       private HashMap<String, Object> getSubAttributeList(EPackage root, String className , String superClass) {
+       private Map<String, Object> getSubAttributeList(EPackage root, String className , String superClass) {
                TreeIterator<EObject> treeItr = root.eAllContents();
                boolean requiredAttribute = false; 
-               HashMap<String, Object> subAttribute = new HashMap<String, Object>();
+               Map<String, Object> subAttribute = new HashMap<>();
                int rollingCount = 0;
                int processClass = 0;
-               boolean annotation = false;
+               boolean annotation;
 
                //    Pulling out dependency from file
                while (treeItr.hasNext() && rollingCount < 2) {  
@@ -312,7 +310,7 @@ public class MSModelUtils {
                        if (requiredAttribute)   {
                                if (obj instanceof EStructuralFeature) {
                                        EStructuralFeature eStrucClassifier = (EStructuralFeature) obj;
-                                       if (eStrucClassifier.getEAnnotations().size() != 0) {
+                                       if (!eStrucClassifier.getEAnnotations().isEmpty()) {
                                                annotation = annotationTest(eStrucClassifier, configuration, onap);
                                                if (annotation &&  obj instanceof EReference) {
                                                        EClass refType = ((EReference) obj).getEReferenceType();
@@ -348,7 +346,7 @@ public class MSModelUtils {
                return ":required-false";
        }
 
-       public JSONObject buildJavaObject(HashMap<String, String> map, String attributeType){
+       public JSONObject buildJavaObject(Map<String, String> map){
 
                JSONObject returnValue = new JSONObject(map);
 
@@ -356,14 +354,14 @@ public class MSModelUtils {
 
        }
 
-       public HashMap<String, String> getRefAttributeList(EPackage root, String className, String superClass){
+       public Map<String, String> getRefAttributeList(EPackage root, String className, String superClass){
 
                TreeIterator<EObject> treeItr = root.eAllContents();
                boolean requiredAttribute = false; 
                HashMap<String, String> refAttribute = new HashMap<>();
                int rollingCount = 0;
                int processClass = 0;
-               boolean annotation = false;
+               boolean annotation;
                //    Pulling out dependency from file
                while (treeItr.hasNext()) {         
                        EObject obj = treeItr.next();
@@ -382,7 +380,7 @@ public class MSModelUtils {
                        if (requiredAttribute)   {
                                if (obj instanceof EStructuralFeature) {
                                        EStructuralFeature eStrucClassifier = (EStructuralFeature) obj;
-                                       if (eStrucClassifier.getEAnnotations().size() != 0) {
+                                       if (!eStrucClassifier.getEAnnotations().isEmpty()) {
                                                annotation = annotationTest(eStrucClassifier, configuration, onap);
                                                if ( annotation &&  obj instanceof EReference) {
                                                        EClass refType = ((EReference) obj).getEReferenceType();
@@ -408,10 +406,10 @@ public class MSModelUtils {
        }
 
        private boolean annotationTest(EStructuralFeature eStrucClassifier, String annotation, String type) {
-               String annotationType = null;
-               EAnnotation eAnnotation = null;
-               String onapType = null;
-               String onapValue = null;
+               String annotationType;
+               EAnnotation eAnnotation;
+               String onapType;
+               String onapValue;
 
                EList<EAnnotation> value = eStrucClassifier.getEAnnotations();
 
@@ -432,9 +430,9 @@ public class MSModelUtils {
 
 
        private String annotationValue(EStructuralFeature eStrucClassifier, ANNOTATION_TYPE annotation, String type) {
-               String annotationType = null;
-               EAnnotation eAnnotation = null;
-               String onapType = null;
+               String annotationType;
+               EAnnotation eAnnotation;
+               String onapType;
                String onapValue = null;
 
                EList<EAnnotation> value = eStrucClassifier.getEAnnotations();
@@ -501,15 +499,15 @@ public class MSModelUtils {
                return returnSubTypes;
        } 
 
-       public HashMap<String, String> getAttributeList(EPackage root, String className, String superClass){
+       public Map<String, String> getAttributeList(EPackage root, String className, String superClass){
 
                TreeIterator<EObject> treeItr = root.eAllContents();
                boolean requiredAttribute = false; 
                HashMap<String, String> refAttribute = new HashMap<>();
-               boolean annotation = false;
-               boolean dictionaryTest = false;
-               String defaultValue = null;
-               String eType = null;
+               boolean annotation;
+               boolean dictionaryTest;
+               String defaultValue;
+               String eType;
 
                //    Pulling out dependency from file
                while (treeItr.hasNext()) {         
@@ -526,7 +524,7 @@ public class MSModelUtils {
                        if (requiredAttribute){
                                if (obj instanceof EStructuralFeature) {
                                        EStructuralFeature eStrucClassifier = (EStructuralFeature) obj;
-                                       if (eStrucClassifier.getEAnnotations().size() != 0) {
+                                       if (!eStrucClassifier.getEAnnotations().isEmpty()) {
                                                annotation = annotationTest(eStrucClassifier, configuration, onap);
                                                dictionaryTest = annotationTest(eStrucClassifier, dictionary, policy);
                                                EClassifier refType = ((EStructuralFeature) obj).getEType();
@@ -578,9 +576,9 @@ public class MSModelUtils {
                return returnValue;
        }
 
-       public Map<String, String> buildSubList(HashMap<String, String> subClassAttributes, HashMap<String, MSAttributeObject> classMap, String className){
+       public Map<String, String> buildSubList(Map<String, String> subClassAttributes, Map<String, MSAttributeObject> classMap, String className){
                Map<String, String> missingValues = new HashMap<>();
-               Map<String, String> workingMap = new HashMap<>();
+               Map<String, String> workingMap;
                boolean enumType;
 
                for ( Entry<String, String> map : classMap.get(className).getRefAttribute().entrySet()){
@@ -604,10 +602,10 @@ public class MSModelUtils {
                return missingValues;
        }
 
-       public Map<String, HashMap<String, String>> recursiveReference(HashMap<String, MSAttributeObject> classMap, String className){
+       public Map<String, Map<String, String>> recursiveReference(Map<String, MSAttributeObject> classMap, String className){
 
-               Map<String, HashMap<String, String>> returnObject = new HashMap<>();
-               HashMap<String, String> returnClass = getRefclass(classMap, className);
+               Map<String, Map<String, String>> returnObject = new HashMap<>();
+               Map<String, String> returnClass = getRefclass(classMap, className);
                returnObject.put(className, returnClass);
                for (Entry<String, String> reAttribute :returnClass.entrySet()){
                        if (reAttribute.getValue().split(":")[1].contains("MANY")){
@@ -622,16 +620,16 @@ public class MSModelUtils {
 
        }
 
-       public String createJson(HashMap<String, Object> subClassAttributes, HashMap<String, MSAttributeObject> classMap, String className) { 
+       public String createJson(Map<String, Object> subClassAttributes, Map<String, MSAttributeObject> classMap, String className) {
                boolean enumType;
-               Map<String, HashMap<String, String>> myObject = new HashMap<>();
+               Map<String, Map<String, String>> myObject = new HashMap<>();
                for ( Entry<String, String> map : classMap.get(className).getRefAttribute().entrySet()){
                        String value = map.getValue().split(":")[0];
                        if (value!=null){
                                enumType = classMap.get(className).getEnumType().containsKey(value);
                                if (!enumType){
                                        if (map.getValue().split(":")[1].contains("MANY")){
-                                               Map<String, HashMap<String, String>> testRecursive = recursiveReference(classMap, map.getValue().split(":")[0] );
+                                               Map<String, Map<String, String>> testRecursive = recursiveReference(classMap, map.getValue().split(":")[0] );
                                                myObject.putAll(testRecursive);
                                        }
                                }
@@ -644,7 +642,7 @@ public class MSModelUtils {
                return json;            
        }
 
-       public HashMap<String, String> getRefclass(HashMap<String, MSAttributeObject> classMap, String className){
+       public Map<String, String> getRefclass(Map<String, MSAttributeObject> classMap, String className){
                HashMap<String, String> missingValues = new HashMap<>();
 
                if (classMap.get(className).getAttribute()!=null || !classMap.get(className).getAttribute().isEmpty()){
@@ -658,12 +656,12 @@ public class MSModelUtils {
                return missingValues;   
        }
 
-       public String createSubAttributes(ArrayList<String> dependency, HashMap<String, MSAttributeObject> classMap, String modelName) {
+       public String createSubAttributes(List<String> dependency, Map<String, MSAttributeObject> classMap, String modelName) {
 
                HashMap <String,  Object>  workingMap = new HashMap<>();
-               MSAttributeObject tempObject = new MSAttributeObject();
+               MSAttributeObject tempObject;
                if (dependency!=null){
-                       if (dependency.size()==0){
+                       if (dependency.isEmpty()){
                                return "{}";
                        }       
                        dependency.add(modelName);
@@ -679,15 +677,15 @@ public class MSModelUtils {
                return returnValue;
        }
 
-       public ArrayList<String> getFullDependencyList(ArrayList<String> dependency, HashMap<String,MSAttributeObject > classMap) {
+       public List<String> getFullDependencyList(List<String> dependency, Map<String,MSAttributeObject > classMap) {
                ArrayList<String> returnList = new ArrayList<>();
-               ArrayList<String> workingList = new ArrayList<>();
+               ArrayList<String> workingList;
                returnList.addAll(dependency);
                for (String element : dependency ){
                        if (classMap.containsKey(element)){
                                MSAttributeObject value = classMap.get(element);
                                String rawValue = StringUtils.replaceEach(value.getDependency(), new String[]{"[", "]"}, new String[]{"", ""});
-                               workingList = new ArrayList<String>(Arrays.asList(rawValue.split(",")));        
+                               workingList = new ArrayList<>(Arrays.asList(rawValue.split(",")));
                                for(String depend : workingList){
                                        if (!returnList.contains(depend) && !depend.isEmpty()){
                                                returnList.add(depend.trim());
index e98a41f..df4fbf6 100644 (file)
@@ -76,7 +76,9 @@ public class PolicyValidation {
        /*
         * This is an empty constructor
         */
-       public PolicyValidation(){}     
+       public PolicyValidation(){
+               // Empty constructor
+       }
        
        
        public StringBuilder validatePolicy(PolicyRestAdapter policyData) throws IOException{
@@ -178,17 +180,17 @@ public class PolicyValidation {
                                                String configBodyData = policyData.getConfigBodyData();
                                                String configType = policyData.getConfigType();
                                                if (configType != null) {
-                                                       if (configType.equals("JSON")) {
+                                                       if ("JSON".equals(configType)) {
                                                                if (!PolicyUtils.isJSONValid(configBodyData)) {
                                                                        responseString.append("Config Body: JSON Content is not valid" + "<br>");
                                                                        valid = false;
                                                                }
-                                                       } else if (configType.equals("XML")) {
+                                                       } else if ("XML".equals(configType)) {
                                                                if (!PolicyUtils.isXMLValid(configBodyData)) {
                                                                        responseString.append("Config Body: XML Content data is not valid" + "<br>");
                                                                        valid = false;
                                                                }
-                                                       } else if (configType.equals("PROPERTIES")) {
+                                                       } else if ("PROPERTIES".equals(configType)) {
                                                                if (!PolicyUtils.isPropValid(configBodyData)||configBodyData.equals("")) {
                                                                        responseString.append("Config Body: Property data is not valid" + "<br>");
                                                                        valid = false;
@@ -384,8 +386,8 @@ public class PolicyValidation {
                                        if(!Strings.isNullOrEmpty(policyData.getServiceType())){
                                                pullJsonKeyPairs((JsonNode) policyData.getPolicyJSON());
 
-                                               String service = null;
-                                               String version = null;
+                                               String service;
+                                               String version;
                                                if (policyData.getServiceType().contains("-v")){
                                                        service = policyData.getServiceType().split("-v")[0];
                                                        version = policyData.getServiceType().split("-v")[1];
@@ -678,15 +680,17 @@ public class PolicyValidation {
        }
 
        protected String emailValidation(String email, String response){
+               String res = response;
                if(email != null){
                        String validateEmail = PolicyUtils.validateEmailAddress(email.replace("\"", ""));
                        if(!validateEmail.contains(SUCCESS)){
-                               response += "<b>Email</b>:<i>" +  validateEmail + HTML_ITALICS_LNBREAK;
-                       }else{
+                               res  += "<b>Email</b>:<i>" +  validateEmail + HTML_ITALICS_LNBREAK;
+                       }
+                       else {
                                return SUCCESS;
                        }
                }
-               return response;
+               return res;
        }
 
        private MicroServiceModels getAttributeObject(String name, String version) {    
index 03c1fb0..ac97fb0 100644 (file)
@@ -62,7 +62,7 @@ public class PolicyValidationRequestWrapper {
                        JsonNode root = mapper.readTree(request.getReader());
                        policyData = mapper.readValue(root.get("policyData").toString(), PolicyRestAdapter.class);
                        
-                       JsonObject json = null;
+                       JsonObject json;
                        json = stringToJsonObject(root.toString());
                        
                        if(json != null){
@@ -181,14 +181,14 @@ public class PolicyValidationRequestWrapper {
                                
                        } else if("Action".equals(parameters.getPolicyClass().toString())){
                                
-                               ArrayList<Object> ruleAlgorithmChoices = new ArrayList<Object>();
+                               ArrayList<Object> ruleAlgorithmChoices = new ArrayList<>();
                                                                
                                List<String> dynamicLabelRuleAlgorithms = parameters.getDynamicRuleAlgorithmLabels();
                                List<String> dynamicFieldFunctionRuleAlgorithms = parameters.getDynamicRuleAlgorithmFunctions();
                                List<String> dynamicFieldOneRuleAlgorithms = parameters.getDynamicRuleAlgorithmField1();
                                List<String> dyrnamicFieldTwoRuleAlgorithms = parameters.getDynamicRuleAlgorithmField2();
                    
-                               if (dynamicLabelRuleAlgorithms != null && dynamicLabelRuleAlgorithms.size() > 0) {
+                               if (dynamicLabelRuleAlgorithms != null && !dynamicLabelRuleAlgorithms.isEmpty()) {
                        int i = dynamicLabelRuleAlgorithms.size() - 1;
 
                        for (String labelAttr : dynamicLabelRuleAlgorithms) {
@@ -349,14 +349,10 @@ public class PolicyValidationRequestWrapper {
                                
        }
        
-    private JsonObject stringToJsonObject(String value)
-            throws JsonException, IllegalStateException {
-       
-       try{
-            JsonReader jsonReader = Json.createReader(new StringReader(value));
-            JsonObject object = jsonReader.readObject();
-            jsonReader.close();
-            return object;
+    private JsonObject stringToJsonObject(String value) {
+
+       try(JsonReader jsonReader = Json.createReader(new StringReader(value))){
+                       return jsonReader.readObject();
         } catch(JsonException| IllegalStateException e){
             LOGGER.info(XACMLErrorConstants.ERROR_DATA_ISSUE+ "Improper JSON format... may or may not cause issues in validating the policy: " + value, e);
             return null;
index ebbbd2f..431482d 100644 (file)
@@ -1702,7 +1702,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController {
        private void retreiveDependency(String workingFile, Boolean modelClass) {
                
                MSModelUtils utils = new MSModelUtils(PolicyController.getMsOnapName(), PolicyController.getMsPolicyName());
-           HashMap<String, MSAttributeObject> tempMap;
+           Map<String, MSAttributeObject> tempMap;
            
            tempMap = utils.processEpackage(workingFile, MODEL_TYPE.XMI);