Fix Sonar bugs 27/9427/1
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Wed, 30 Aug 2017 12:58:36 +0000 (05:58 -0700)
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Wed, 30 Aug 2017 12:58:36 +0000 (05:58 -0700)
In service java package Blocker issues fixed

Change-Id: I5c6ff6374c40d8e24c4fa920ca2af139761b9e4a
Issue-Id: CLAMP-43
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
src/main/java/org/onap/clamp/clds/service/CldsService.java
src/main/java/org/onap/clamp/clds/service/LogServiceImpl.java

index c0f7111..3d6d54a 100644 (file)
 
 package org.onap.clamp.clds.service;
 
+import com.att.ajsc.common.AjscService;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.sql.SQLException;
@@ -52,7 +60,6 @@ import javax.xml.transform.TransformerException;
 import org.apache.commons.lang3.StringUtils;
 import org.camunda.bpm.engine.RuntimeService;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.jboss.resteasy.spi.BadRequestException;
 import org.onap.clamp.clds.client.DcaeDispatcherServices;
 import org.onap.clamp.clds.client.DcaeInventoryServices;
 import org.onap.clamp.clds.client.SdcCatalogServices;
@@ -79,14 +86,6 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.client.HttpClientErrorException;
 
-import com.att.ajsc.common.AjscService;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -595,14 +594,13 @@ public class CldsService extends SecureServiceBase {
      *
      * @param test
      * @param dcaeEvent
-     * @throws BadRequestException
      */
     @ApiOperation(value = "Accepts events for a model", notes = "", response = String.class)
     @POST
     @Path("/dcae/event")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
-    public String postDcaeEvent(@QueryParam("test") String test, DcaeEvent dcaeEvent) throws BadRequestException {
+    public String postDcaeEvent(@QueryParam("test") String test, DcaeEvent dcaeEvent) {
         Date startTime = new Date();
         LoggingUtils.setRequestContext("CldsService: Post dcae event", getPrincipalName());
         String userid = null;
@@ -929,7 +927,7 @@ public class CldsService extends SecureServiceBase {
             }
             operationStatus = dcaeDispatcherServices.getOperationStatus(createNewDeploymentStatusUrl);
         }
-        if (operationStatus != null && operationStatus.equalsIgnoreCase("succeeded")) {
+        if (operationStatus.equalsIgnoreCase("succeeded")) {
             String artifactName = model.getControlName();
             if (artifactName != null) {
                 artifactName = artifactName + ".yml";
@@ -973,7 +971,7 @@ public class CldsService extends SecureServiceBase {
             }
             operationStatus = dcaeDispatcherServices.getOperationStatus(operationStatusUndeployUrl);
         }
-        if (operationStatus != null && operationStatus.equalsIgnoreCase("succeeded")) {
+        if (operationStatus.equalsIgnoreCase("succeeded")) {
             String artifactName = model.getControlName();
             if (artifactName != null) {
                 artifactName = artifactName + ".yml";
index f38e129..2f02aa6 100644 (file)
 
 package org.onap.clamp.clds.service;
 
+import com.att.ajsc.camunda.core.AttCamundaHistoryEvent;
+import com.att.ajsc.camunda.core.AttCamundaService;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.google.gson.Gson;
+
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -51,25 +57,19 @@ import org.springframework.mail.SimpleMailMessage;
 import org.springframework.mail.javamail.JavaMailSenderImpl;
 import org.springframework.stereotype.Service;
 
-import com.att.ajsc.camunda.core.AttCamundaHistoryEvent;
-import com.att.ajsc.camunda.core.AttCamundaService;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.google.gson.Gson;
-
 @Service
 public class LogServiceImpl implements LogService {
-    protected static final EELFLogger       logger      = EELFManager.getInstance().getLogger(LogServiceImpl.class);
+    protected static final EELFLogger logger      = EELFManager.getInstance().getLogger(LogServiceImpl.class);
     protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
 
     @Autowired
-    private RuntimeService          runtimeService;
+    private RuntimeService            runtimeService;
 
     @Autowired
-    private HistoryService          historyService;
+    private HistoryService            historyService;
 
     @Context
-    private MessageContext          context;
+    private MessageContext            context;
 
     public void setRuntimeService(RuntimeService runtimeService) {
         this.runtimeService = runtimeService;
@@ -165,7 +165,6 @@ public class LogServiceImpl implements LogService {
                 if (classUrl != null) {
                     logger.info(LogMessages.LOGSERVICE_EMAIL_CLASS, classUrl.getFile());
                 } else {
-                    logger.info(LogMessages.LOGSERVICE_EMAIL_CLASS, classUrl.getFile());
                     logger.info(LogMessages.LOGSERVICE_EMAIL_CLASS_NULL);
                 }
                 email.send();