diff options
author | Steve Smokowski <ss835w@att.com> | 2019-04-15 12:48:31 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-15 12:48:31 +0000 |
commit | 9c0663079469cb5a42c96ff990385c23be2f361e (patch) | |
tree | c0516c2ddb973cc5cb258eb7efe98c58bac0058d /adapters/mso-openstack-adapters/src | |
parent | b18391cff78f426f4d958aed17242b679a52fc1d (diff) | |
parent | eb3ea71f0f733850ded51332d67ca6d11c1d282f (diff) |
Merge "Code Enhancement (Sonar Fixes)"
Diffstat (limited to 'adapters/mso-openstack-adapters/src')
5 files changed, 12 insertions, 16 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AAIObjectAudit.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AAIObjectAudit.java index 149de0b698..0a186ccb82 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AAIObjectAudit.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AAIObjectAudit.java @@ -2,7 +2,6 @@ package org.onap.so.adapters.audit; import java.io.Serializable; import java.net.URI; -import org.onap.so.client.aai.AAIObjectType; import org.apache.commons.lang3.builder.ToStringBuilder; public class AAIObjectAudit implements Serializable { diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java index d46229ae8e..947c6ddfeb 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java @@ -27,14 +27,11 @@ import java.util.Map; import java.util.Optional; import org.camunda.bpm.client.task.ExternalTask; import org.camunda.bpm.client.task.ExternalTaskService; -import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.audit.beans.AuditInventory; import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @@ -47,7 +44,7 @@ public class AuditCreateStackService extends AbstractAuditService { public HeatStackAudit heatStackAudit; @Autowired - public Environment env; + public Environment environment; protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) { AuditInventory auditInventory = externalTask.getVariable("auditInventory"); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java index aca6e9e268..048e6dbba2 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java @@ -25,12 +25,10 @@ import java.util.Map; import java.util.Optional; import org.camunda.bpm.client.task.ExternalTask; import org.camunda.bpm.client.task.ExternalTaskService; -import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.audit.beans.AuditInventory; import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @@ -44,7 +42,7 @@ public class AuditDeleteStackService extends AbstractAuditService { public HeatStackAudit heatStackAudit; @Autowired - public Environment env; + public Environment environment; protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) { AuditInventory auditInventory = externalTask.getVariable("auditInventory"); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java index 5c0d2d3019..627f6a276c 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java @@ -54,6 +54,8 @@ public class HeatStackAudit { protected static final Logger logger = LoggerFactory.getLogger(HeatStackAudit.class); + private static final String exceptionMsg = "Error finding Path from Self Link"; + @Autowired protected MsoHeatUtils heat; @@ -110,10 +112,10 @@ public class HeatStackAudit { processNestedResourceGroup(cloudRegion, tenantId, vServersWithLInterface, nestedResourceGroupResources); } else - throw new Exception("Error finding Path from Self Link"); + throw new Exception(exceptionMsg); } catch (Exception e) { logger.error("Error Parsing Link to obtain Path", e); - throw new Exception("Error finding Path from Self Link"); + throw new Exception(exceptionMsg); } } } @@ -143,7 +145,7 @@ public class HeatStackAudit { addSubInterfaceToVserver(vServersWithLInterface, subinterfaceStack, subinterfaceResources); } } else - throw new Exception("Error finding Path from Self Link"); + throw new Exception(exceptionMsg); } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java index 76881bd58b..b1908d9541 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java @@ -29,23 +29,23 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class ContrailSubnetHostRoutes { @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route") - private List<ContrailSubnetHostRoute> host_routes = new ArrayList<ContrailSubnetHostRoute>(); + private List<ContrailSubnetHostRoute> hostRoutes = new ArrayList<>(); public ContrailSubnetHostRoutes() {} public List<ContrailSubnetHostRoute> getHost_routes() { - return host_routes; + return hostRoutes; } public void setHost_routes(List<ContrailSubnetHostRoute> host_routes) { - this.host_routes = host_routes; + this.hostRoutes = host_routes; } @Override public String toString() { StringBuilder buf = new StringBuilder(); - if (host_routes != null) { - for (ContrailSubnetHostRoute hr : host_routes) { + if (hostRoutes != null) { + for (ContrailSubnetHostRoute hr : hostRoutes) { buf.append(hr.toString()); } } |