lower code smells 13/108613/2
authorRupinder <rupinsi1@in.ibm.com>
Mon, 1 Jun 2020 08:57:56 +0000 (14:27 +0530)
committerTakamune Cho <takamune.cho@att.com>
Thu, 4 Jun 2020 15:29:06 +0000 (15:29 +0000)
Issue-ID: APPC-1859
Change-Id: I6d0a7563199355a446345f568415a78856c0cfa6
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/RequestValidatorImpl.java
appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/InterfacesServiceProviderImpl.java
appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImpl.java
appc-oam/appc-oam-bundle/src/main/java/org/onap/appc/oam/AppcOam.java
appc-sequence-generator/appc-sequence-generator-bundle/src/main/java/org/onap/appc/seqgen/provider/SequenceGeneratorProvider.java
services/appc-dmaap-service/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/LCM/model/DmaapIncomingMessage.java

index 6605d1e..5e43d39 100644 (file)
@@ -434,12 +434,12 @@ public class RequestValidatorImpl extends AbstractRequestValidatorImpl {
         return vnfContext;
     }
 
-    private SvcLogicContext getVnfdata(String vnf_id, String prefix, SvcLogicContext ctx) throws VNFNotFoundException {
+    private SvcLogicContext getVnfdata(String vnfId, String prefix, SvcLogicContext ctx) throws VNFNotFoundException {
         if (logger.isTraceEnabled()) {
-            logger.trace("Entering to getVnfdata with vnfid = " + ObjectUtils.toString(vnf_id) + ", prefix = "
+            logger.trace("Entering to getVnfdata with vnfid = " + ObjectUtils.toString(vnfId) + ", prefix = "
                     + ObjectUtils.toString(prefix) + ", SvcLogicContext" + ObjectUtils.toString(ctx));
         }
-        String key = "vnf-id = '" + vnf_id + "'";
+        String key = "vnf-id = '" + vnfId + "'";
         logger.debug("inside getVnfdata=== " + key);
         try {
             Date beginTimestamp = new Date();
@@ -452,9 +452,9 @@ public class RequestValidatorImpl extends AbstractRequestValidatorImpl {
                     LoggingConstants.TargetNames.AAI, LoggingConstants.TargetServiceNames.AAIServiceNames.QUERY, status,
                     "", response.name(), this.getClass().getCanonicalName());
             if (SvcLogicResource.QueryStatus.NOT_FOUND.equals(response)) {
-                throw new VNFNotFoundException("VNF not found for vnf_id = " + vnf_id, vnf_id);
+                throw new VNFNotFoundException("VNF not found for vnf_id = " + vnfId, vnfId);
             } else if (SvcLogicResource.QueryStatus.FAILURE.equals(response)) {
-                throw new RuntimeException("Error Querying AAI with vnfID = " + vnf_id);
+                throw new RuntimeException("Error Querying AAI with vnfID = " + vnfId);
             }
             logger.info("AAIResponse: " + response.toString());
         } catch (SvcLogicException e) {
index ba05de7..22822d8 100644 (file)
@@ -50,7 +50,7 @@ public class InterfacesServiceProviderImpl implements InterfacesServiceService{
 
         log.info("Received Request: " + input.getRequest().getRequestId() + " Action : " + 
                 input.getRequest().getAction() + " with RequestData  :" + input.getRequest().getRequestData() + " and data-Type : " + input.getRequest().getRequestDataType());
-        String request_id = input.getRequest().getRequestId();
+        String requestId = input.getRequest().getRequestId();
         String action = input.getRequest().getAction();
         ResponseInfoBuilder responseInfoBuilder = new ResponseInfoBuilder();
         ExecuteServiceOutputBuilder executeServicebuilder = new ExecuteServiceOutputBuilder();
@@ -59,7 +59,7 @@ public class InterfacesServiceProviderImpl implements InterfacesServiceService{
         try{
             String response = serviceExecutor.execute(action, input.getRequest().getRequestData(), input.getRequest().getRequestDataType());
             responseInfoBuilder.setBlock(response);
-            responseInfoBuilder.setRequestId(request_id);
+            responseInfoBuilder.setRequestId(requestId);
             statusBuilder.setCode("400");
             statusBuilder.setMessage("success");
         }
index f82402f..405dfcf 100644 (file)
@@ -92,8 +92,8 @@ public class ServiceExecutorImpl {
 
         AaiService aaiService = getAaiService(aaiClient);
         SvcLogicContext ctx = getSvcLogicContext();
-        Map<String, String> params = new HashMap<String, String>();
-        List<String> inProgressVServerIds = new ArrayList<String>();
+        Map<String, String> params = new HashMap<>();
+        List<String> inProgressVServerIds = new ArrayList<>();
         String currentVnfcVserverId = new String();
         String currentRequestVnfcName = scopeOverlap.getCurrentRequest().getActionIdentifiers().getVnfcName();
         String currentRequestVServerId = scopeOverlap.getCurrentRequest().getActionIdentifiers().getvServerId();
@@ -101,10 +101,10 @@ public class ServiceExecutorImpl {
         params.put("vnfId", scopeOverlap.getVnfId());
         try {
             aaiService.getGenericVnfInfo(params, ctx);
-            int vm_count = Integer.parseInt(ctx.getAttribute("vm-count"));
+            int vmCount = Integer.parseInt(ctx.getAttribute("vm-count"));
                 for(Request inprogressRequest:inProgressRequests){
                     if(inprogressRequest.getActionIdentifiers().getVnfcName() != null){
-                        for (int i = 0; i < vm_count; i++) {
+                        for (int i = 0; i < vmCount; i++) {
                             if (ctx.getAttribute("vm[" + i + "].vnfc-name") != null && ctx.getAttribute("vm[" + i + "].vnfc-name")
                                     .equals(inprogressRequest.getActionIdentifiers().getVnfcName())) {
                                 String newInProgressVserverId = ctx.getAttribute("vm[" + i + "].vserver-id");
@@ -118,7 +118,7 @@ public class ServiceExecutorImpl {
                 if(inProgVserverIds.getActionIdentifiers().getvServerId() != null)
                     inProgressVServerIds.add(inProgVserverIds.getActionIdentifiers().getvServerId());
             if(currentRequestVnfcName != null){
-                for (int i = 0; i < vm_count; i++) {
+                for (int i = 0; i < vmCount; i++) {
                     if (ctx.getAttribute("vm[" + i + "].vnfc-name") != null && ctx.getAttribute("vm[" + i + "].vnfc-name")
                             .equals(currentRequestVnfcName)) {
                         currentVnfcVserverId = ctx.getAttribute("vm[" + i + "].vserver-id");
index 50c6d49..1f7c989 100644 (file)
@@ -80,7 +80,6 @@ import org.onap.appc.statemachine.impl.readers.AppcOamMetaDataReader.AppcOperati
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.Future;
 
 /**
  * RPC class of APP-C OAM API.
index 7770536..cc7a144 100644 (file)
@@ -89,7 +89,7 @@ public class SequenceGeneratorProvider implements AutoCloseable,SequenceGenerato
     protected BindingAwareBroker.RpcRegistration<SequenceGeneratorService> rpcRegistration;
     private final EELFLogger log = EELFManager.getInstance().getLogger(SequenceGeneratorProvider.class);
     private final ExecutorService executor;
-    private final static String APP_NAME = "SequenceGeneratorProvider";
+    private static final String APP_NAME = "SequenceGeneratorProvider";
 
     public SequenceGeneratorProvider(DataBroker dataBroker2, NotificationPublishService notificationProviderService,
             RpcProviderRegistry rpcRegistry2) {
index 8b45e4b..91d3ede 100644 (file)
@@ -33,7 +33,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class DmaapIncomingMessage extends DmaapMessage{
-    private final static String defaultCambriaPartition = "APP-C";
+    private static final String defaultCambriaPartition = "APP-C";
 
     public DmaapIncomingMessage() {
         super();